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

Fix pylint errors (#5933)

* Fix pylint errors.

* Also adjust to https://github.com/ansible/ansible/pull/79909.
This commit is contained in:
Felix Fontein 2023-02-04 17:05:08 +01:00 committed by GitHub
parent a64df658c5
commit b1d9507cd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 9 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

@ -88,8 +88,8 @@ from ansible_collections.community.general.plugins.module_utils.gconftool2 impor
class GConftool(StateModuleHelper): class GConftool(StateModuleHelper):
change_params = 'value', change_params = ('value', )
diff_params = 'value', diff_params = ('value', )
output_params = ('key', 'value_type') output_params = ('key', 'value_type')
facts_params = ('key', 'value_type') facts_params = ('key', 'value_type')
facts_name = 'gconftool2' facts_name = 'gconftool2'

View file

@ -181,7 +181,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)

View file

@ -118,7 +118,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)

View file

@ -336,7 +336,7 @@ def main():
user_gravatar=dict(required=False, type="bool", default=None), user_gravatar=dict(required=False, type="bool", default=None),
user_mac_addresses=dict(required=False, type="list", elements="str", default=None), user_mac_addresses=dict(required=False, type="list", elements="str", default=None),
) )
), )
module = AnsibleModule(argument_spec=argument_spec) module = AnsibleModule(argument_spec=argument_spec)

View file

@ -160,7 +160,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)

View file

@ -628,9 +628,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. "

View file

@ -356,6 +356,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']

View file

@ -169,8 +169,8 @@ from ansible_collections.community.general.plugins.module_utils.xfconf import xf
class XFConfProperty(StateModuleHelper): class XFConfProperty(StateModuleHelper):
change_params = 'value', change_params = ('value', )
diff_params = 'value', diff_params = ('value', )
output_params = ('property', 'channel', 'value') output_params = ('property', 'channel', 'value')
module = dict( module = dict(
argument_spec=dict( argument_spec=dict(