mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #5933/b1d9507c backport][stable-6] Fix pylint errors (#5937)
Fix pylint errors (#5933)
* Fix pylint errors.
* Also adjust to https://github.com/ansible/ansible/pull/79909.
(cherry picked from commit b1d9507cd2
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
ead9524dc3
commit
d8cf32e6c4
9 changed files with 12 additions and 9 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)."
|
|
@ -88,8 +88,8 @@ from ansible_collections.community.general.plugins.module_utils.gconftool2 impor
|
|||
|
||||
|
||||
class GConftool(StateModuleHelper):
|
||||
change_params = 'value',
|
||||
diff_params = 'value',
|
||||
change_params = ('value', )
|
||||
diff_params = ('value', )
|
||||
output_params = ('key', 'value_type')
|
||||
facts_params = ('key', 'value_type')
|
||||
facts_name = 'gconftool2'
|
||||
|
|
|
@ -181,7 +181,7 @@ def main():
|
|||
required=False, choices=["present", "absent"], default="present"
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ def main():
|
|||
dict(
|
||||
organization=dict(required=False, type="str", default=None, aliases=["org"])
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ def main():
|
|||
user_gravatar=dict(required=False, type="bool", default=None),
|
||||
user_mac_addresses=dict(required=False, type="list", elements="str", default=None),
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ def main():
|
|||
default="client",
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||
|
||||
|
|
|
@ -628,9 +628,9 @@ def main():
|
|||
|
||||
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)
|
||||
outputs = {}
|
||||
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))
|
||||
outputs = {}
|
||||
elif rc != 0:
|
||||
module.fail_json(
|
||||
msg="Failure when getting Terraform outputs. "
|
||||
|
|
|
@ -356,6 +356,7 @@ class NosystemdTimezone(Timezone):
|
|||
def __init__(self, module):
|
||||
super(NosystemdTimezone, self).__init__(module)
|
||||
# Validate given timezone
|
||||
planned_tz = ''
|
||||
if 'name' in self.value:
|
||||
tzfile = self._verify_timezone()
|
||||
planned_tz = self.value['name']['planned']
|
||||
|
|
|
@ -169,8 +169,8 @@ from ansible_collections.community.general.plugins.module_utils.xfconf import xf
|
|||
|
||||
|
||||
class XFConfProperty(StateModuleHelper):
|
||||
change_params = 'value',
|
||||
diff_params = 'value',
|
||||
change_params = ('value', )
|
||||
diff_params = ('value', )
|
||||
output_params = ('property', 'channel', 'value')
|
||||
facts_params = ('property', 'channel', 'value')
|
||||
module = dict(
|
||||
|
|
Loading…
Reference in a new issue