1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[stable-5] Fix pylint errors (#5938)

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:
Felix Fontein 2023-02-04 17:28:15 +01:00 committed by GitHub
parent a467da2f39
commit 6932a937c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 7 deletions

View 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)."

View file

@ -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. "

View file

@ -181,7 +181,7 @@ def main():
required=False, choices=["present", "absent"], default="present"
),
)
),
)
module = AnsibleModule(argument_spec=argument_spec)

View file

@ -116,7 +116,7 @@ def main():
dict(
organization=dict(required=False, type="str", default=None, aliases=["org"])
)
),
)
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)

View file

@ -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)

View file

@ -158,7 +158,7 @@ def main():
default="client",
),
)
),
)
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)

View file

@ -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']

View file

@ -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(