Surround top-level function and class definitions with two blank lines.

This commit is contained in:
Joren Vrancken 2018-07-29 13:46:06 +02:00 committed by Toshio Kuratomi
parent 9e310558ee
commit b954917761
373 changed files with 408 additions and 28 deletions

View file

@ -344,5 +344,6 @@ class LibcloudInventory(object):
def main():
LibcloudInventory()
if __name__ == '__main__':
main()

View file

@ -583,6 +583,7 @@ class AosInventory(object):
for key, value in device.value['status'].items():
self.add_var_to_host(device.name, key, value)
# Run the script
if __name__ == '__main__':
AosInventory()

View file

@ -482,4 +482,5 @@ class CloudFormsInventory(object):
else:
return json.dumps(data)
CloudFormsInventory()

View file

@ -312,4 +312,5 @@ class CobblerInventory(object):
else:
return json.dumps(data)
CobblerInventory()

View file

@ -528,4 +528,5 @@ class ConsulConfig(dict):
token = 'anonymous'
return consul.Consul(host=host, port=port, token=token, scheme=scheme)
ConsulInventory()

View file

@ -889,4 +889,5 @@ def main():
DockerInventory().run()
main()

View file

@ -436,5 +436,6 @@ class ForemanInventory(object):
self._print_data()
return True
if __name__ == '__main__':
sys.exit(not ForemanInventory().run())

View file

@ -534,6 +534,7 @@ class GceInventory(object):
else:
return json.dumps(data)
# Run the script
if __name__ == '__main__':
GceInventory()

View file

@ -65,5 +65,6 @@ def main(argv):
else:
print("Need an argument, either --list or --host <host>", file=sys.stderr)
if __name__ == '__main__':
main(sys.argv)

View file

@ -129,6 +129,7 @@ class MDTInventory(object):
parser.add_argument('--host', action='store', help='Get all the variables about a specific instance')
self.args = parser.parse_args()
if __name__ == "__main__":
# Run the script
MDTInventory()

View file

@ -173,4 +173,5 @@ class NagiosLivestatusInventory(object):
else:
sys.exit("usage: --list or --host HOSTNAME [--pretty]")
NagiosLivestatusInventory()

View file

@ -105,4 +105,5 @@ class NagiosNDOInventory(object):
else:
sys.exit("Error: Database configuration is missing. See nagios_ndo.ini.")
NagiosNDOInventory()

View file

@ -339,5 +339,6 @@ def main():
elif args.host:
print(client.do_host(args.host))
if __name__ == '__main__':
main()

View file

@ -288,5 +288,6 @@ class OVirtInventory(object):
else:
return json.dumps(data)
# Run the script
OVirtInventory()

View file

@ -258,5 +258,6 @@ def main():
)
)
if __name__ == '__main__':
main()

View file

@ -185,7 +185,6 @@ def load_config_file():
return None
else:
return p
p = load_config_file()
def rax_slugify(value):
@ -469,5 +468,6 @@ def main():
sys.exit(0)
p = load_config_file()
if __name__ == '__main__':
main()

View file

@ -294,5 +294,6 @@ class RudderInventory(object):
return re.sub(r'[^A-Za-z0-9\_]', '_', word)
# Run the script
RudderInventory()

View file

@ -198,4 +198,5 @@ class SoftLayerInventory(object):
self.get_virtual_servers()
self.get_physical_servers()
SoftLayerInventory()

View file

@ -30,6 +30,7 @@ class SetEncoder(json.JSONEncoder):
return list(obj)
return json.JSONEncoder.default(self, obj)
VBOX = "VBoxManage"

View file

@ -152,4 +152,5 @@ class ZabbixInventory(object):
print("Error: Configuration of server and credentials are required. See zabbix.ini.", file=sys.stderr)
sys.exit(1)
ZabbixInventory()

View file

@ -92,5 +92,6 @@ def main():
for host, result in callback.host_unreachable.items():
print('{0} >>> {1}'.format(host, result._result['msg']))
if __name__ == '__main__':
main()

View file

@ -26,5 +26,6 @@ def main():
print(C.DEFAULT_MODULE_PATH)
return 0
if __name__ == '__main__':
sys.exit(main())

View file

@ -77,6 +77,7 @@ def _fileobj_to_fd(fileobj):
raise ValueError("Invalid file descriptor: {0}".format(fd))
return fd
# Python 3.5 uses a more direct route to wrap system calls to increase speed.
if sys.version_info >= (3, 5):
def _syscall_wrapper(func, _, *args, **kwargs):
@ -305,6 +306,7 @@ class BaseSelector(object):
def __exit__(self, *args):
self.close()
# Almost all platforms have select.select()
if hasattr(select, "select"):
class SelectSelector(BaseSelector):

View file

@ -34,6 +34,7 @@ class SQLParseError(Exception):
class UnclosedQuoteError(SQLParseError):
pass
# maps a type of identifier to the maximum number of dot levels that are
# allowed to specify that identifier. For example, a database column can be
# specified by up to 4 levels: database.schema.table.column

View file

@ -61,6 +61,7 @@ def list_dict_str(value):
return value
raise TypeError
ARG_ATTRIBUTES_BLACKLIST = ('property_path',)
COMMON_ARG_SPEC = {

View file

@ -77,6 +77,7 @@ def aci_argument_spec():
validate_certs=dict(type='bool', default=True),
)
'''
URL_MAPPING = dict(
action_rule=dict(aci_class='rtctrlAttrP', mo='attr-', key='name'),

View file

@ -81,6 +81,7 @@ def getRuleString(deviceType, variableId):
return retVal
# EOM
default_cnos = {
'vlan_id': 'INTEGER_VALUE:1-3999',
'vlan_id_range': 'INTEGER_VALUE_RANGE:1-3999',

View file

@ -43,6 +43,7 @@ def get_exception():
"""
return sys.exc_info()[1]
try:
# Python 2.6+
from ast import literal_eval

View file

@ -228,6 +228,7 @@ class _SixMetaPathImporter(object):
return None
get_source = get_code # same as get_code
_importer = _SixMetaPathImporter(__name__)
@ -490,6 +491,7 @@ class Module_six_moves_urllib(types.ModuleType):
def __dir__(self):
return ['parse', 'error', 'request', 'response', 'robotparser']
_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"),
"moves.urllib")

View file

@ -295,6 +295,7 @@ class NoSSLError(SSLValidationError):
"""Needed to connect to an HTTPS url but no ssl library available to verify the certificate"""
pass
# Some environments (Google Compute Engine's CoreOS deploys) do not compile
# against openssl and thus do not have any HTTPS support.
CustomHTTPSConnection = CustomHTTPSHandler = None

View file

@ -222,5 +222,6 @@ def main():
module.exit_json(**result)
if __name__ == '__main__':
main()

View file

@ -325,5 +325,6 @@ def main():
else:
delete_glue_connection(connection_glue, module, glue_connection)
if __name__ == '__main__':
main()

View file

@ -361,5 +361,6 @@ def main():
else:
delete_glue_job(connection, module, glue_job)
if __name__ == '__main__':
main()

View file

@ -187,5 +187,6 @@ def main():
elif state == 'absent':
destroy_bucket_cors(client, module)
if __name__ == '__main__':
main()

View file

@ -727,5 +727,6 @@ def main():
module.exit_json(changed=changed, **camel_dict_to_snake_dict(response))
if __name__ == '__main__':
main()

View file

@ -535,5 +535,6 @@ def main():
module.exit_json(**facts_result)
if __name__ == '__main__':
main()

View file

@ -354,5 +354,6 @@ def main():
module.exit_json(**facts_result)
if __name__ == '__main__':
main()

View file

@ -569,5 +569,6 @@ def main():
else:
delete_elb(elb)
if __name__ == '__main__':
main()

View file

@ -415,5 +415,6 @@ def main():
else:
delete_elb(elb)
if __name__ == '__main__':
main()

View file

@ -312,5 +312,6 @@ def main():
else:
deregister_target(connection, module)
if __name__ == '__main__':
main()

View file

@ -204,6 +204,7 @@ def to_template_params(health_check):
params['string_match_part'] = HealthCheck.XMLStringMatchPart % {'string_match': health_check.string_match}
return params
XMLResourcePathPart = """<ResourcePath>%(resource_path)s</ResourcePath>"""
POSTXMLBody = """

View file

@ -309,5 +309,6 @@ def main():
"""Main execution"""
AzureRMAvailabilitySet()
if __name__ == '__main__':
main()

View file

@ -172,5 +172,6 @@ def main():
AzureRMAvailabilitySetFacts()
if __name__ == '__main__':
main()

View file

@ -424,5 +424,6 @@ def main():
"""Main execution"""
AzureRMContainerInstance()
if __name__ == '__main__':
main()

View file

@ -424,5 +424,6 @@ def main():
"""Main execution"""
AzureRMContainerRegistry()
if __name__ == '__main__':
main()

View file

@ -388,5 +388,6 @@ def gethash(self):
def main():
AzureRMRecordSet()
if __name__ == '__main__':
main()

View file

@ -197,5 +197,6 @@ class AzureRMRecordSetFacts(AzureRMModuleBase):
def main():
AzureRMRecordSetFacts()
if __name__ == '__main__':
main()

View file

@ -236,5 +236,6 @@ def zone_to_dict(zone):
def main():
AzureRMDNSZone()
if __name__ == '__main__':
main()

View file

@ -177,5 +177,6 @@ class AzureRMDNSZoneFacts(AzureRMModuleBase):
def main():
AzureRMDNSZoneFacts()
if __name__ == '__main__':
main()

View file

@ -309,5 +309,6 @@ def main():
AzureRMFunctionApp()
if __name__ == '__main__':
main()

View file

@ -316,5 +316,6 @@ class AzureRMImage(AzureRMModuleBase):
def main():
AzureRMImage()
if __name__ == '__main__':
main()

View file

@ -489,5 +489,6 @@ def main():
"""Main execution"""
AzureRMVaults()
if __name__ == '__main__':
main()

View file

@ -291,5 +291,6 @@ class AzureRMKeyVaultKey(AzureRMModuleBase):
def main():
AzureRMKeyVaultKey()
if __name__ == '__main__':
main()

View file

@ -212,5 +212,6 @@ class AzureRMKeyVaultSecret(AzureRMModuleBase):
def main():
AzureRMKeyVaultSecret()
if __name__ == '__main__':
main()

View file

@ -970,5 +970,6 @@ def main():
"""Main execution"""
AzureRMLoadBalancer()
if __name__ == '__main__':
main()

View file

@ -170,5 +170,6 @@ def main():
AzureRMLoadBalancerFacts()
if __name__ == '__main__':
main()

View file

@ -384,5 +384,6 @@ def main():
"""Main execution"""
AzureRMManagedDisk()
if __name__ == '__main__':
main()

View file

@ -166,5 +166,6 @@ def main():
AzureRMManagedDiskFacts()
if __name__ == '__main__':
main()

View file

@ -299,5 +299,6 @@ def main():
"""Main execution"""
AzureRMDatabases()
if __name__ == '__main__':
main()

View file

@ -373,5 +373,6 @@ def main():
"""Main execution"""
AzureRMServers()
if __name__ == '__main__':
main()

View file

@ -206,5 +206,6 @@ class AzureRMNetworkInterfaceFacts(AzureRMModuleBase):
def main():
AzureRMNetworkInterfaceFacts()
if __name__ == '__main__':
main()

View file

@ -299,5 +299,6 @@ def main():
"""Main execution"""
AzureRMDatabases()
if __name__ == '__main__':
main()

View file

@ -372,5 +372,6 @@ def main():
"""Main execution"""
AzureRMServers()
if __name__ == '__main__':
main()

View file

@ -282,5 +282,6 @@ class AzureRMPublicIPAddress(AzureRMModuleBase):
def main():
AzureRMPublicIPAddress()
if __name__ == '__main__':
main()

View file

@ -251,5 +251,6 @@ class AzureRMResourceGroup(AzureRMModuleBase):
def main():
AzureRMResourceGroup()
if __name__ == '__main__':
main()

View file

@ -152,5 +152,6 @@ class AzureRMResourceGroupFacts(AzureRMModuleBase):
def main():
AzureRMResourceGroupFacts()
if __name__ == '__main__':
main()

View file

@ -270,5 +270,6 @@ class AzureRMSecurityGroupFacts(AzureRMModuleBase):
def main():
AzureRMSecurityGroupFacts()
if __name__ == '__main__':
main()

View file

@ -495,5 +495,6 @@ def main():
"""Main execution"""
AzureRMDatabases()
if __name__ == '__main__':
main()

View file

@ -321,5 +321,6 @@ def main():
"""Main execution"""
AzureRMServers()
if __name__ == '__main__':
main()

View file

@ -200,5 +200,7 @@ class AzureRMServersFacts(AzureRMModuleBase):
def main():
AzureRMServersFacts()
if __name__ == '__main__':
main()

View file

@ -451,5 +451,6 @@ class AzureRMStorageAccount(AzureRMModuleBase):
def main():
AzureRMStorageAccount()
if __name__ == '__main__':
main()

View file

@ -545,5 +545,6 @@ class AzureRMStorageBlob(AzureRMModuleBase):
def main():
AzureRMStorageBlob()
if __name__ == '__main__':
main()

View file

@ -311,5 +311,6 @@ class AzureRMSubnet(AzureRMModuleBase):
def main():
AzureRMSubnet()
if __name__ == '__main__':
main()

View file

@ -309,5 +309,6 @@ def main():
"""Main execution"""
AzureRMVMExtension()
if __name__ == '__main__':
main()

View file

@ -851,5 +851,6 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
def main():
AzureRMVirtualMachineScaleSet()
if __name__ == '__main__':
main()

View file

@ -277,5 +277,6 @@ def main():
AzureRMVirtualMachineScaleSetFacts()
if __name__ == '__main__':
main()

View file

@ -215,5 +215,6 @@ class AzureRMVirtualMachineImageFacts(AzureRMModuleBase):
def main():
AzureRMVirtualMachineImageFacts()
if __name__ == '__main__':
main()

View file

@ -344,5 +344,6 @@ class AzureRMVirtualNetwork(AzureRMModuleBase):
def main():
AzureRMVirtualNetwork()
if __name__ == '__main__':
main()

View file

@ -176,5 +176,6 @@ class AzureRMNetworkInterfaceFacts(AzureRMModuleBase):
def main():
AzureRMNetworkInterfaceFacts()
if __name__ == '__main__':
main()

View file

@ -290,5 +290,6 @@ def main():
elif module.state == 'absent':
module.state_absent()
if __name__ == '__main__':
main()

View file

@ -327,5 +327,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -327,5 +327,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -852,5 +852,6 @@ class BackeServiConneDrain(object):
u'drainingTimeoutSec': self.request.get(u'drainingTimeoutSec')
})
if __name__ == '__main__':
main()

View file

@ -631,5 +631,6 @@ class DiskSourSnapEncrKey(object):
u'sha256': self.request.get(u'sha256')
})
if __name__ == '__main__':
main()

View file

@ -473,5 +473,6 @@ class FirewallAllowedArray(object):
u'ports': item.get(u'ports')
})
if __name__ == '__main__':
main()

View file

@ -521,5 +521,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -323,5 +323,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -572,5 +572,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -795,5 +795,6 @@ class HealChecSslHealChec(object):
u'proxyHeader': self.request.get(u'proxyHeader')
})
if __name__ == '__main__':
main()

View file

@ -398,5 +398,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -397,5 +397,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -749,5 +749,6 @@ class ImagSourDiskEncrKey(object):
u'sha256': self.request.get(u'sha256')
})
if __name__ == '__main__':
main()

View file

@ -1464,5 +1464,6 @@ class InstanceTags(object):
u'items': self.request.get(u'items')
})
if __name__ == '__main__':
main()

View file

@ -430,5 +430,6 @@ class InstaGroupNamedPortsArray(object):
u'port': item.get(u'port')
})
if __name__ == '__main__':
main()

View file

@ -591,5 +591,6 @@ class InstGrouManaNamePortArray(object):
u'port': item.get(u'port')
})
if __name__ == '__main__':
main()

View file

@ -1439,5 +1439,6 @@ class InstancTemplatTags(object):
u'items': self.request.get(u'items')
})
if __name__ == '__main__':
main()

View file

@ -354,5 +354,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -414,5 +414,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -338,5 +338,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

View file

@ -386,5 +386,6 @@ def raise_if_errors(response, err_path, module):
if errors is not None:
module.fail_json(msg=errors)
if __name__ == '__main__':
main()

Some files were not shown because too many files have changed in this diff Show more