Multiple minor fixes (#58374)

* Documentation update
* Typo fixes
* fail_json fixes

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/58387/head
Abhijeet Kasurde 5 years ago committed by ansibot
parent 77e01e6abc
commit 7d6f417f32

@ -34,7 +34,7 @@ options:
required: true required: true
artifact_store: artifact_store:
description: description:
- Location information where articacts are stored (on S3). Dictionary with fields type and location. - Location information where artifacts are stored (on S3). Dictionary with fields type and location.
required: true required: true
suboptions: suboptions:
type: type:
@ -71,13 +71,13 @@ extends_documentation_fragment:
EXAMPLES = ''' EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details. # Note: These examples do not set authentication details, see the AWS Guide for details.
# Example for creating a pipeline for continouos deploy of Github code to an ECS cluster (container) # Example for creating a pipeline for continuous deploy of Github code to an ECS cluster (container)
- code_pipeline: - code_pipeline:
name: my_deploy_pipeline name: my_deploy_pipeline
role_arn: arn:aws:iam::123456:role/AWS-CodePipeline-Service role_arn: arn:aws:iam::123456:role/AWS-CodePipeline-Service
artifact_store: artifact_store:
type: S3 type: S3
locatation: my_s3_codepipline_bucket location: my_s3_codepipline_bucket
stages: stages:
- name: Get_source - name: Get_source
actions: actions:
@ -159,7 +159,7 @@ pipeline:
type: complex type: complex
contains: contains:
type: type:
desrciption: The type of the artifacts store, such as S3 description: The type of the artifacts store, such as S3
returned: always returned: always
type: string type: string
sample: S3 sample: S3

@ -287,7 +287,7 @@ def release_address(ec2, address, check_mode):
# If we're in check mode, nothing else to do # If we're in check mode, nothing else to do
if not check_mode: if not check_mode:
if not address.release(): if not address.release():
EIPException('release failed') raise EIPException('release failed')
return {'changed': True} return {'changed': True}

@ -633,7 +633,7 @@ class PgHbaRule(dict):
return 1 return 1
if isinstance(sourceobj, str): if isinstance(sourceobj, str):
return 0 return 0
raise PgHbaValueError('This source {1} is of an unknown type...'.format(sourceobj)) raise PgHbaValueError('This source {0} is of an unknown type...'.format(sourceobj))
def db_weight(self): def db_weight(self):
"""Report the weight of the database. """Report the weight of the database.

@ -34,7 +34,7 @@ options:
type: 'str' type: 'str'
description: description:
- Desired state of the mediatype. - Desired state of the mediatype.
- On C(present), it will create a medatype if it does not exist or update the mediatype if the associated data is different. - On C(present), it will create a mediatype if it does not exist or update the mediatype if the associated data is different.
- On C(absent), it will remove the mediatype if it exists. - On C(absent), it will remove the mediatype if it exists.
choices: choices:
- present - present
@ -131,7 +131,7 @@ options:
smtp_authentication: smtp_authentication:
type: 'bool' type: 'bool'
description: description:
- Whether SMTP authetication with username and password should be enabled or not. - Whether SMTP authentication with username and password should be enabled or not.
- If set to C(true), C(username) and C(password) should be specified. - If set to C(true), C(username) and C(password) should be specified.
default: false default: false
smtp_security: smtp_security:
@ -476,7 +476,6 @@ def delete_mediatype(module, zbx, mediatype_id):
def update_mediatype(module, zbx, **kwargs): def update_mediatype(module, zbx, **kwargs):
try: try:
pass
mediatype_id = zbx.mediatype.update(kwargs) mediatype_id = zbx.mediatype.update(kwargs)
except Exception as e: except Exception as e:
module.fail_json(msg="Failed to update mediatype '{_id}': {e}".format(_id=kwargs['mediatypeid'], e=e)) module.fail_json(msg="Failed to update mediatype '{_id}': {e}".format(_id=kwargs['mediatypeid'], e=e))

@ -515,11 +515,11 @@ def main():
if mode == 'access' and state == 'present' and not access_vlan: if mode == 'access' and state == 'present' and not access_vlan:
msg = 'access_vlan param required for mode=access && state=present' msg = 'access_vlan param required for mode=access && state=present'
module.fail_json(msg) module.fail_json(msg=msg)
if mode == 'trunk' and access_vlan: if mode == 'trunk' and access_vlan:
msg = 'access_vlan param not supported when using mode=trunk' msg = 'access_vlan param not supported when using mode=trunk'
module.fail_json(msg) module.fail_json(msg=msg)
if not is_switchport(name, module): if not is_switchport(name, module):
module.fail_json(msg='Ensure interface is configured to be a L2' module.fail_json(msg='Ensure interface is configured to be a L2'
@ -538,7 +538,7 @@ def main():
# If there isn't an existing, something is wrong per previous comment # If there isn't an existing, something is wrong per previous comment
if not existing: if not existing:
msg = 'Make sure you are using the FULL interface name' msg = 'Make sure you are using the FULL interface name'
module.fail_json(msg) module.fail_json(msg=msg)
if trunk_vlans or trunk_allowed_vlans: if trunk_vlans or trunk_allowed_vlans:
if trunk_vlans: if trunk_vlans:

@ -154,7 +154,7 @@ def main():
unsubscribe_channels(channelname, client, session, systname, sys_id) unsubscribe_channels(channelname, client, session, systname, sys_id)
module.exit_json(changed=True, msg="Channel %s removed" % channelname) module.exit_json(changed=True, msg="Channel %s removed" % channelname)
except Exception as e: except Exception as e:
module.fail_json('Unable to %s channel (%s): %s' % ('add' if state == 'present' else 'remove', channelname, to_text(e))) module.fail_json(msg='Unable to %s channel (%s): %s' % ('add' if state == 'present' else 'remove', channelname, to_text(e)))
finally: finally:
client.auth.logout(session) client.auth.logout(session)

@ -267,7 +267,7 @@ def main():
if module.check_mode: if module.check_mode:
cmd += " --noop" cmd += " --noop"
if p['use_srv_records'] is not None: if p['use_srv_records'] is not None:
if not ['use_srv_records']: if not p['use_srv_records']:
cmd += " --no-use_srv_records" cmd += " --no-use_srv_records"
else: else:
cmd += " --use_srv_records" cmd += " --use_srv_records"

Loading…
Cancel
Save