mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Ensure RAT does not report marvin generated files as noncompliant in developer environment
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
e08281838a
commit
6a1ecae552
2
pom.xml
2
pom.xml
@ -382,8 +382,10 @@
|
|||||||
<exclude>tools/appliance/definitions/systemvmtemplate/definition.rb</exclude>
|
<exclude>tools/appliance/definitions/systemvmtemplate/definition.rb</exclude>
|
||||||
<exclude>tools/appliance/definitions/systemvmtemplate/preseed.cfg</exclude>
|
<exclude>tools/appliance/definitions/systemvmtemplate/preseed.cfg</exclude>
|
||||||
<exclude>tools/appliance/definitions/systemvmtemplate/zerodisk.sh</exclude>
|
<exclude>tools/appliance/definitions/systemvmtemplate/zerodisk.sh</exclude>
|
||||||
|
<exclude>tools/cli/cloudmonkey.egg-info/*</exclude>
|
||||||
<exclude>tools/devcloud/src/deps/boxes/basebox-build/definition.rb</exclude>
|
<exclude>tools/devcloud/src/deps/boxes/basebox-build/definition.rb</exclude>
|
||||||
<exclude>tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg</exclude>
|
<exclude>tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg</exclude>
|
||||||
|
<exclude>tools/marvin/Marvin.egg-info/*</exclude>
|
||||||
<exclude>ui/lib/flot/jquery.colorhelpers.js</exclude>
|
<exclude>ui/lib/flot/jquery.colorhelpers.js</exclude>
|
||||||
<exclude>ui/lib/flot/jquery.flot.crosshair.js</exclude>
|
<exclude>ui/lib/flot/jquery.flot.crosshair.js</exclude>
|
||||||
<exclude>ui/lib/flot/jquery.flot.fillbetween.js</exclude>
|
<exclude>ui/lib/flot/jquery.flot.fillbetween.js</exclude>
|
||||||
|
|||||||
@ -48,6 +48,26 @@ class codeGenerator:
|
|||||||
self.subclass = []
|
self.subclass = []
|
||||||
self.outputFolder = outputFolder
|
self.outputFolder = outputFolder
|
||||||
self.apiSpecFile = apiSpecFile
|
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):
|
def addAttribute(self, attr, pro):
|
||||||
value = pro.value
|
value = pro.value
|
||||||
@ -81,25 +101,7 @@ class codeGenerator:
|
|||||||
|
|
||||||
self.cmd = cmd
|
self.cmd = cmd
|
||||||
self.cmdsName.append(self.cmd.name)
|
self.cmdsName.append(self.cmd.name)
|
||||||
license = """\
|
self.code = self.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 += "\n"
|
self.code += "\n"
|
||||||
self.code += '"""%s"""\n'%self.cmd.desc
|
self.code += '"""%s"""\n'%self.cmd.desc
|
||||||
self.code += 'from baseCmd import *\n'
|
self.code += 'from baseCmd import *\n'
|
||||||
@ -186,25 +188,28 @@ class codeGenerator:
|
|||||||
initCmdsList += '"%s",'%cmdName
|
initCmdsList += '"%s",'%cmdName
|
||||||
|
|
||||||
fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', 'w')
|
fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', 'w')
|
||||||
|
fp.write(self.license)
|
||||||
for item in [header, imports, body]:
|
for item in [header, imports, body]:
|
||||||
fp.write(item)
|
fp.write(item)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
'''generate __init__.py'''
|
'''generate __init__.py'''
|
||||||
initCmdsList += '"cloudstackAPIClient"]'
|
initCmdsList = self.license + initCmdsList + '"cloudstackAPIClient"]'
|
||||||
fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w')
|
fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w')
|
||||||
fp.write(initCmdsList)
|
fp.write(initCmdsList)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w')
|
fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w')
|
||||||
basecmd = '"""Base Command"""\n'
|
basecmd = self.license
|
||||||
|
basecmd += '"""Base Command"""\n'
|
||||||
basecmd += 'class baseCmd:\n'
|
basecmd += 'class baseCmd:\n'
|
||||||
basecmd += self.space + 'pass\n'
|
basecmd += self.space + 'pass\n'
|
||||||
fp.write(basecmd)
|
fp.write(basecmd)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
fp = open(self.outputFolder + '/cloudstackAPI/baseResponse.py', 'w')
|
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 += 'class baseResponse:\n'
|
||||||
basecmd += self.space + 'pass\n'
|
basecmd += self.space + 'pass\n'
|
||||||
fp.write(basecmd)
|
fp.write(basecmd)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user