mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
added collection name to module.deprecate() calls; fixed pep8 linting issues
This commit is contained in:
committed by
Seth Foster
parent
378a0711c2
commit
25ca8d22d6
@@ -163,7 +163,7 @@ class ControllerAPIModule(ControllerModule):
|
|||||||
if len(sample['json']['results']) > 1:
|
if len(sample['json']['results']) > 1:
|
||||||
sample['json']['results'] = sample['json']['results'][:2] + ['...more results snipped...']
|
sample['json']['results'] = sample['json']['results'][:2] + ['...more results snipped...']
|
||||||
url = self.build_url(endpoint, query_params)
|
url = self.build_url(endpoint, query_params)
|
||||||
display_endpoint = url.geturl()[len(self.host) :] # truncate to not include the base URL
|
display_endpoint = url.geturl()[len(self.host):] # truncate to not include the base URL
|
||||||
self.fail_json(
|
self.fail_json(
|
||||||
msg="Request to {0} returned {1} items, expected 1".format(display_endpoint, response['json']['count']),
|
msg="Request to {0} returned {1} items, expected 1".format(display_endpoint, response['json']['count']),
|
||||||
query=query_params,
|
query=query_params,
|
||||||
|
|||||||
@@ -398,9 +398,15 @@ def main():
|
|||||||
# Deprecation warnings
|
# Deprecation warnings
|
||||||
for legacy_input in OLD_INPUT_NAMES:
|
for legacy_input in OLD_INPUT_NAMES:
|
||||||
if module.params.get(legacy_input) is not None:
|
if module.params.get(legacy_input) is not None:
|
||||||
module.deprecate(msg='{0} parameter has been deprecated, please use inputs instead'.format(legacy_input), version="ansible.tower:4.0.0")
|
module.deprecate(
|
||||||
|
collection_name=DOCUMENTATION.module,
|
||||||
|
msg='{0} parameter has been deprecated, please use inputs instead'.format(legacy_input),
|
||||||
|
version="4.0.0")
|
||||||
if kind:
|
if kind:
|
||||||
module.deprecate(msg='The kind parameter has been deprecated, please use credential_type instead', version="ansible.tower:4.0.0")
|
module.deprecate(
|
||||||
|
collection_name=DOCUMENTATION.module,
|
||||||
|
msg='The kind parameter has been deprecated, please use credential_type instead',
|
||||||
|
version="4.0.0")
|
||||||
|
|
||||||
cred_type_id = module.resolve_name_to_id('credential_types', credential_type if credential_type else KIND_CHOICES[kind])
|
cred_type_id = module.resolve_name_to_id('credential_types', credential_type if credential_type else KIND_CHOICES[kind])
|
||||||
if organization:
|
if organization:
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ def main():
|
|||||||
max_interval = 30
|
max_interval = 30
|
||||||
interval = abs((min_interval + max_interval) / 2)
|
interval = abs((min_interval + max_interval) / 2)
|
||||||
module.deprecate(
|
module.deprecate(
|
||||||
|
collection_name=DOCUMENTATION.module,
|
||||||
msg="Min and max interval have been deprecated, please use interval instead; interval will be set to {0}".format(interval),
|
msg="Min and max interval have been deprecated, please use interval instead; interval will be set to {0}".format(interval),
|
||||||
version="ansible.tower:4.0.0",
|
version="ansible.tower:4.0.0",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -401,7 +401,9 @@ def main():
|
|||||||
for legacy_input in OLD_INPUT_NAMES:
|
for legacy_input in OLD_INPUT_NAMES:
|
||||||
if module.params.get(legacy_input) is not None:
|
if module.params.get(legacy_input) is not None:
|
||||||
module.deprecate(
|
module.deprecate(
|
||||||
msg='{0} parameter has been deprecated, please use notification_configuration instead'.format(legacy_input), version="ansible.tower:4.0.0"
|
collection_name=DOCUMENTATION.module,
|
||||||
|
msg='{0} parameter has been deprecated, please use notification_configuration instead'.format(legacy_input),
|
||||||
|
version="4.0.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Attempt to look up the related items the user specified (these will fail the module if not found)
|
# Attempt to look up the related items the user specified (these will fail the module if not found)
|
||||||
|
|||||||
Reference in New Issue
Block a user