From 6a1ecae552e8857c8e97c283962d14db4479a9a1 Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Sat, 2 Mar 2013 16:49:02 +0530 Subject: [PATCH] Ensure RAT does not report marvin generated files as noncompliant in developer environment Signed-off-by: Prasanna Santhanam --- pom.xml | 2 ++ tools/marvin/marvin/codegenerator.py | 49 +++++++++++++++------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index dde205f6d7c..3219ab0f06f 100644 --- a/pom.xml +++ b/pom.xml @@ -382,8 +382,10 @@ tools/appliance/definitions/systemvmtemplate/definition.rb tools/appliance/definitions/systemvmtemplate/preseed.cfg tools/appliance/definitions/systemvmtemplate/zerodisk.sh + tools/cli/cloudmonkey.egg-info/* tools/devcloud/src/deps/boxes/basebox-build/definition.rb tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg + tools/marvin/Marvin.egg-info/* ui/lib/flot/jquery.colorhelpers.js ui/lib/flot/jquery.flot.crosshair.js ui/lib/flot/jquery.flot.fillbetween.js diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py index cce91008dba..ed9248c49a3 100644 --- a/tools/marvin/marvin/codegenerator.py +++ b/tools/marvin/marvin/codegenerator.py @@ -48,6 +48,26 @@ class codeGenerator: self.subclass = [] self.outputFolder = outputFolder self.apiSpecFile = apiSpecFile + lic = """\ + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + + """ + self.license = dedent(lic) def addAttribute(self, attr, pro): value = pro.value @@ -81,25 +101,7 @@ class codeGenerator: self.cmd = cmd self.cmdsName.append(self.cmd.name) - license = """\ - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - """ - self.code = dedent(license) + self.code = self.license self.code += "\n" self.code += '"""%s"""\n'%self.cmd.desc self.code += 'from baseCmd import *\n' @@ -186,25 +188,28 @@ class codeGenerator: initCmdsList += '"%s",'%cmdName fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', 'w') + fp.write(self.license) for item in [header, imports, body]: fp.write(item) fp.close() '''generate __init__.py''' - initCmdsList += '"cloudstackAPIClient"]' + initCmdsList = self.license + initCmdsList + '"cloudstackAPIClient"]' fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w') fp.write(initCmdsList) fp.close() fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w') - basecmd = '"""Base Command"""\n' + basecmd = self.license + basecmd += '"""Base Command"""\n' basecmd += 'class baseCmd:\n' basecmd += self.space + 'pass\n' fp.write(basecmd) fp.close() fp = open(self.outputFolder + '/cloudstackAPI/baseResponse.py', 'w') - basecmd = '"""Base class for response"""\n' + basecmd = self.license + basecmd += '"""Base class for response"""\n' basecmd += 'class baseResponse:\n' basecmd += self.space + 'pass\n' fp.write(basecmd)