mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[stable-4] Fix pylint errors (#5939)
Fix pylint errors (#5933)
* Fix pylint errors.
* Also adjust to https://github.com/ansible/ansible/pull/79909.
(cherry picked from commit b1d9507cd2
)
This commit is contained in:
parent
a7783c48ff
commit
bbe74d2b17
8 changed files with 10 additions and 7 deletions
2
changelogs/fragments/5933-linting.yml
Normal file
2
changelogs/fragments/5933-linting.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "terraform and timezone - slight refactoring to avoid linter reporting potentially undefined variables (https://github.com/ansible-collections/community.general/pull/5933)."
|
|
@ -508,9 +508,9 @@ def main():
|
||||||
|
|
||||||
outputs_command = [command[0], 'output', '-no-color', '-json'] + _state_args(state_file)
|
outputs_command = [command[0], 'output', '-no-color', '-json'] + _state_args(state_file)
|
||||||
rc, outputs_text, outputs_err = module.run_command(outputs_command, cwd=project_path)
|
rc, outputs_text, outputs_err = module.run_command(outputs_command, cwd=project_path)
|
||||||
|
outputs = {}
|
||||||
if rc == 1:
|
if rc == 1:
|
||||||
module.warn("Could not get Terraform outputs. This usually means none have been defined.\nstdout: {0}\nstderr: {1}".format(outputs_text, outputs_err))
|
module.warn("Could not get Terraform outputs. This usually means none have been defined.\nstdout: {0}\nstderr: {1}".format(outputs_text, outputs_err))
|
||||||
outputs = {}
|
|
||||||
elif rc != 0:
|
elif rc != 0:
|
||||||
module.fail_json(
|
module.fail_json(
|
||||||
msg="Failure when getting Terraform outputs. "
|
msg="Failure when getting Terraform outputs. "
|
||||||
|
|
|
@ -180,7 +180,7 @@ def main():
|
||||||
required=False, choices=["present", "absent"], default="present"
|
required=False, choices=["present", "absent"], default="present"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=argument_spec)
|
module = AnsibleModule(argument_spec=argument_spec)
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ def main():
|
||||||
dict(
|
dict(
|
||||||
organization=dict(required=False, type="str", default=None, aliases=["org"])
|
organization=dict(required=False, type="str", default=None, aliases=["org"])
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ def main():
|
||||||
user_disabled=dict(required=False, type="bool", default=None),
|
user_disabled=dict(required=False, type="bool", default=None),
|
||||||
user_gravatar=dict(required=False, type="bool", default=None),
|
user_gravatar=dict(required=False, type="bool", default=None),
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=argument_spec)
|
module = AnsibleModule(argument_spec=argument_spec)
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ def main():
|
||||||
default="client",
|
default="client",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||||
|
|
||||||
|
|
|
@ -355,6 +355,7 @@ class NosystemdTimezone(Timezone):
|
||||||
def __init__(self, module):
|
def __init__(self, module):
|
||||||
super(NosystemdTimezone, self).__init__(module)
|
super(NosystemdTimezone, self).__init__(module)
|
||||||
# Validate given timezone
|
# Validate given timezone
|
||||||
|
planned_tz = ''
|
||||||
if 'name' in self.value:
|
if 'name' in self.value:
|
||||||
tzfile = self._verify_timezone()
|
tzfile = self._verify_timezone()
|
||||||
planned_tz = self.value['name']['planned']
|
planned_tz = self.value['name']['planned']
|
||||||
|
|
|
@ -172,8 +172,8 @@ class XFConfException(Exception):
|
||||||
|
|
||||||
|
|
||||||
class XFConfProperty(CmdStateModuleHelper):
|
class XFConfProperty(CmdStateModuleHelper):
|
||||||
change_params = 'value',
|
change_params = ('value', )
|
||||||
diff_params = 'value',
|
diff_params = ('value', )
|
||||||
output_params = ('property', 'channel', 'value')
|
output_params = ('property', 'channel', 'value')
|
||||||
facts_params = ('property', 'channel', 'value')
|
facts_params = ('property', 'channel', 'value')
|
||||||
module = dict(
|
module = dict(
|
||||||
|
|
Loading…
Reference in a new issue