diff options
| author | Martin Basti <mbasti@redhat.com> | 2016-10-04 16:54:44 +0200 |
|---|---|---|
| committer | Martin Basti <mbasti@redhat.com> | 2016-10-06 10:43:36 +0200 |
| commit | d9375881460d63cdd696bb0705da0ac205db9870 (patch) | |
| tree | 3c7c4016f6b5ffd48f390d74003dffdf97b6a0ea /install/tools | |
| parent | ac94d32c4fd543e33211c0331330c80c619e0058 (diff) | |
| download | freeipa-d9375881460d63cdd696bb0705da0ac205db9870.tar.gz freeipa-d9375881460d63cdd696bb0705da0ac205db9870.tar.xz freeipa-d9375881460d63cdd696bb0705da0ac205db9870.zip | |
Pylint: remove unused variables from installers and scripts
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'install/tools')
| -rwxr-xr-x | install/tools/ipa-adtrust-install | 17 | ||||
| -rwxr-xr-x | install/tools/ipa-replica-manage | 16 | ||||
| -rwxr-xr-x | install/tools/ipactl | 10 |
3 files changed, 19 insertions, 24 deletions
diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install index 13c62aa0b..378627da8 100755 --- a/install/tools/ipa-adtrust-install +++ b/install/tools/ipa-adtrust-install @@ -45,8 +45,6 @@ from ipaplatform.paths import paths from ipapython.ipa_log_manager import root_logger, standard_logging_setup from ipapython.dn import DN -# pylint: disable=unused-variable - if six.PY3: unicode = str @@ -87,7 +85,7 @@ def parse_options(): dest="enable_compat", default=False, action="store_true", help="Enable support for trusted domains for old clients") - options, args = parser.parse_args() + options, _args = parser.parse_args() safe_options = parser.get_safe_opts(options) return safe_options, options @@ -215,7 +213,7 @@ def set_and_check_netbios_name(netbios_name, unattended): def ensure_admin_kinit(admin_name, admin_password): try: ipautil.run(['kinit', admin_name], stdin=admin_password+'\n') - except ipautil.CalledProcessError as e: + except ipautil.CalledProcessError: print("There was error to automatically re-kinit your admin user ticket.") return False return True @@ -357,8 +355,8 @@ def main(): try: root_logger.debug("Searching for objects with missing SID with " "filter=%s, base_dn=%s", filter, base_dn) - (entries, truncated) = api.Backend.ldap2.find_entries(filter=filter, - base_dn=base_dn, attrs_list=['']) + entries, _truncated = api.Backend.ldap2.find_entries( + filter=filter, base_dn=base_dn, attrs_list=['']) except errors.NotFound: # All objects have SIDs assigned pass @@ -413,7 +411,7 @@ def main(): try: # Search only masters which have support for domain levels # because only these masters will have SSSD recent enough to support AD trust agents - (entries_m, truncated) = smb.admin_conn.find_entries( + entries_m, _truncated = smb.admin_conn.find_entries( filter="(&(objectclass=ipaSupportedDomainLevelConfig)(ipaMaxDomainLevel=*)(ipaMinDomainLevel=*))", base_dn=masters_dn, attrs_list=['cn'], scope=ldap.SCOPE_ONELEVEL) except errors.NotFound: @@ -423,8 +421,9 @@ def main(): print(unicode(e)) try: - (entries_a, truncated) = smb.admin_conn.find_entries(filter="", - base_dn=agents_dn, attrs_list=['member'], scope=ldap.SCOPE_BASE) + entries_a, _truncated = smb.admin_conn.find_entries( + filter="", base_dn=agents_dn, attrs_list=['member'], + scope=ldap.SCOPE_BASE) except errors.NotFound: pass except (errors.DatabaseError, errors.NetworkError) as e: diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index 6152898d1..d9dee9cb1 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -45,8 +45,6 @@ from ipaclient import ipadiscovery from six.moves.xmlrpc_client import MAXINT from ipaplatform.paths import paths -# pylint: disable=unused-variable - # dict of command name and tuples of min/max num of args needed commands = { "list":(0, 1, "[master fqdn]", ""), @@ -142,7 +140,7 @@ def test_connection(realm, host, nolookup=False): if not nolookup: enforce_host_existence(host) replman = replication.ReplicationManager(realm, host, None) - ents = replman.find_replication_agreements() + replman.find_replication_agreements() del replman return True except errors.ACIError: @@ -216,7 +214,7 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose, nolookup=False): if winsync_peer: repl = replication.ReplicationManager(realm, winsync_peer, dirman_passwd) - cn, dn = repl.agreement_dn(replica) + _cn, dn = repl.agreement_dn(replica) entries = repl.conn.get_entries( dn, conn.SCOPE_BASE, "(objectclass=nsDSWindowsReplicationAgreement)") @@ -308,7 +306,7 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False): try: repl2.set_readonly(readonly=True) repl2.force_sync(repl2.conn, replica1) - cn, dn = repl2.agreement_dn(repl1.conn.host) + _cn, dn = repl2.agreement_dn(repl1.conn.host) repl2.wait_for_repl_update(repl2.conn, dn, 30) (range_start, range_max) = repl2.get_DNA_range(repl2.conn.host) (next_start, next_max) = repl2.get_DNA_next_range(repl2.conn.host) @@ -391,7 +389,9 @@ def get_ruv(realm, host, dirman_passwd, nolookup=False, ca=False): data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv) if data: rid = data.group(1) - (scheme, netloc, path, params, query, fragment) = urlparse(data.group(2)) + ( + _scheme, netloc, _path, _params, _query, _fragment + ) = urlparse(data.group(2)) servers.append((netloc, rid)) else: print("unable to decode: %s" % ruv) @@ -1323,7 +1323,7 @@ def store_DNA_range(repl, range_start, range_max, deleted_master, realm, except Exception as e: print("Connection failed: %s" % e) continue - (next_start, next_max) = repl2.get_DNA_next_range(candidate) + next_start, _next_max = repl2.get_DNA_next_range(candidate) if next_start is None: try: return repl2.save_DNA_next_range(range_start, range_max) @@ -1359,7 +1359,7 @@ def set_DNA_range(hostname, range, realm, dirman_passwd, next_range=False, """ try: (dna_next, dna_max) = range.split('-', 1) - except ValueError as e: + except ValueError: return "Invalid range, must be the form x-y" try: diff --git a/install/tools/ipactl b/install/tools/ipactl index d22973838..42bd73e74 100755 --- a/install/tools/ipactl +++ b/install/tools/ipactl @@ -39,9 +39,6 @@ from ipapython.dn import DN from ipaplatform import services from ipaplatform.paths import paths -# pylint: disable=unused-variable - - MSG_HINT_IGNORE_SERVICE_FAILURE = ( "Hint: You can use --ignore-service-failure option for forced start in " "case that a non-critical service failed" @@ -89,7 +86,7 @@ def is_dirsrv_debugging_enabled(): fd.close() for line in lines: if line.lower().startswith('nsslapd-errorlog-level'): - (option, value) = line.split(':') + _option, value = line.split(':') if int(value) > 0: debugging = True @@ -239,7 +236,7 @@ def get_config_from_file(): def_svc_list.append([s[1], s[0]]) ordered_list = [] - for (order, svc) in sorted(def_svc_list): + for _order, svc in sorted(def_svc_list): if svc in svc_list: ordered_list.append(svc) @@ -286,7 +283,6 @@ def ipa_start(options): except Exception as e: raise IpactlError("Failed to start Directory Service: " + str(e)) - ldap_list = [] try: svc_list = get_config(dirsrv) except Exception as e: @@ -540,7 +536,7 @@ def main(): # LSB status code 4: user had insufficient privilege raise IpactlError("You must be root to run ipactl.", 4) - safe_options, options, args = parse_options() + _safe_options, options, args = parse_options() if len(args) != 1: # LSB status code 2: invalid or excess argument(s) |
