Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pylint errors #5933

Merged
merged 2 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/5933-linting.yml
Original file line number Diff line number Diff line change
@@ -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)."
4 changes: 2 additions & 2 deletions plugins/modules/gconftool2.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@


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'
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/pritunl_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def main():
required=False, choices=["present", "absent"], default="present"
),
)
),
)

module = AnsibleModule(argument_spec=argument_spec)

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/pritunl_org_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/pritunl_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/pritunl_user_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def main():
default="client",
),
)
),
)

module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ def process_complex_args(vars):

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. "
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/xfconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@


class XFConfProperty(StateModuleHelper):
change_params = 'value',
diff_params = 'value',
change_params = ('value', )
diff_params = ('value', )
output_params = ('property', 'channel', 'value')
module = dict(
argument_spec=dict(
Expand Down