From 07c1a5ee61cb5a72ab769cb97ad0611c2986d2e6 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman <rjeffman@redhat.com> Date: Wed, 12 Jul 2023 18:42:57 -0300 Subject: [PATCH] pylint: Unnecessary parens after '=' keyword This patch removes unnecessary usage of parens on attributions. --- plugins/modules/ipaconfig.py | 4 ++-- plugins/modules/ipadnsforwardzone.py | 2 +- plugins/modules/ipadnsrecord.py | 2 +- plugins/modules/ipaservice.py | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/modules/ipaconfig.py b/plugins/modules/ipaconfig.py index 8e6bb98f..a32376cc 100644 --- a/plugins/modules/ipaconfig.py +++ b/plugins/modules/ipaconfig.py @@ -476,7 +476,7 @@ def main(): params = {} for x in field_map: val = ansible_module.params_get( - x, allow_empty_string=(x in allow_empty_string)) + x, allow_empty_string=x in allow_empty_string) if val is not None: params[field_map.get(x, x)] = val @@ -619,7 +619,7 @@ def main(): # boolean values, so we need to convert it to str # for comparison. # See: https://github.com/freeipa/freeipa/pull/6294 - exit_args[k] = (str(value[0]).upper() == "TRUE") + exit_args[k] = str(value[0]).upper() == "TRUE" else: if arg_type not in type_map: raise ValueError( diff --git a/plugins/modules/ipadnsforwardzone.py b/plugins/modules/ipadnsforwardzone.py index 87ed9826..93a31f5e 100644 --- a/plugins/modules/ipadnsforwardzone.py +++ b/plugins/modules/ipadnsforwardzone.py @@ -258,7 +258,7 @@ def main(): invalid = [ "forwarders", "forwardpolicy", "skip_overlap_check", "permission" ] - wants_enable = (state == "enabled") + wants_enable = state == "enabled" if operation == "del": invalid = [ diff --git a/plugins/modules/ipadnsrecord.py b/plugins/modules/ipadnsrecord.py index 75ae4492..f027791c 100644 --- a/plugins/modules/ipadnsrecord.py +++ b/plugins/modules/ipadnsrecord.py @@ -1453,7 +1453,7 @@ def define_commands_for_present_state(module, zone_name, entry, res_find): else: # Create reverse records for existing records for ipv in ['a', 'aaaa']: - record = ('%srecord' % ipv) + record = '%srecord' % ipv if record in args and ('%s_extra_create_reverse' % ipv) in args: cmds = create_reverse_ip_record( module, zone_name, name, args[record]) diff --git a/plugins/modules/ipaservice.py b/plugins/modules/ipaservice.py index 0409b0b7..d0f56098 100644 --- a/plugins/modules/ipaservice.py +++ b/plugins/modules/ipaservice.py @@ -414,15 +414,15 @@ def gen_args(pac_type, auth_ind, skip_host_check, force, requires_pre_auth, if auth_ind is not None: _args['krbprincipalauthind'] = auth_ind if skip_host_check is not None: - _args['skip_host_check'] = (skip_host_check) + _args['skip_host_check'] = skip_host_check if force is not None: - _args['force'] = (force) + _args['force'] = force if requires_pre_auth is not None: - _args['ipakrbrequirespreauth'] = (requires_pre_auth) + _args['ipakrbrequirespreauth'] = requires_pre_auth if ok_as_delegate is not None: - _args['ipakrbokasdelegate'] = (ok_as_delegate) + _args['ipakrbokasdelegate'] = ok_as_delegate if ok_to_auth_as_delegate is not None: - _args['ipakrboktoauthasdelegate'] = (ok_to_auth_as_delegate) + _args['ipakrboktoauthasdelegate'] = ok_to_auth_as_delegate return _args @@ -433,9 +433,9 @@ def gen_args_smb(netbiosname, ok_as_delegate, ok_to_auth_as_delegate): if netbiosname is not None: _args['ipantflatname'] = netbiosname if ok_as_delegate is not None: - _args['ipakrbokasdelegate'] = (ok_as_delegate) + _args['ipakrbokasdelegate'] = ok_as_delegate if ok_to_auth_as_delegate is not None: - _args['ipakrboktoauthasdelegate'] = (ok_to_auth_as_delegate) + _args['ipakrboktoauthasdelegate'] = ok_to_auth_as_delegate return _args -- GitLab