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 /client | |
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 'client')
-rwxr-xr-x | client/ipa-client-automount | 12 | ||||
-rwxr-xr-x | client/ipa-client-install | 17 |
2 files changed, 11 insertions, 18 deletions
diff --git a/client/ipa-client-automount b/client/ipa-client-automount index 91bdc88f4..88adb0a50 100755 --- a/client/ipa-client-automount +++ b/client/ipa-client-automount @@ -45,8 +45,6 @@ from ipaplatform.tasks import tasks from ipaplatform import services from ipaplatform.paths import paths -# pylint: disable=unused-variable - def parse_options(): usage = "%prog [options]\n" parser = OptionParser(usage=usage) @@ -81,7 +79,7 @@ def wait_for_sssd(): try: ipautil.run(["getent", "passwd", "admin@%s" % api.env.realm]) found = True - except Exception as e: + except Exception: time.sleep(1) n = n + 1 @@ -180,7 +178,7 @@ def configure_autofs_sssd(fstore, statestore, autodiscover, options): if provider == "ipa": domain.add_provider('ipa', 'autofs') try: - location = domain.get_option('ipa_automount_location') + domain.get_option('ipa_automount_location') sys.exit('An automount location is already configured') except SSSDConfig.NoOptionError: domain.set_option('ipa_automount_location', options.location) @@ -373,7 +371,7 @@ def main(): if not fstore.has_files() and not os.path.exists(paths.IPA_DEFAULT_CONF): sys.exit('IPA client is not configured on this system.\n') - options, args = parse_options() + options, _args = parse_options() standard_logging_setup( paths.IPACLIENT_INSTALL_LOG, verbose=False, debug=options.debug, @@ -400,7 +398,6 @@ def main(): sys.exit('automount is already configured on this system.\n') autodiscover = False - servers = [] ds = ipadiscovery.IPADiscovery() if not options.server: print("Searching for IPA server...") @@ -437,7 +434,6 @@ def main(): print("IPA server: DNS discovery") root_logger.debug('Configuring to use DNS discovery') - search_base = str(DN(('cn', options.location), api.env.container_automount, api.env.basedn)) print("Location: %s" % options.location) root_logger.debug('Using automount location %s' % options.location) @@ -457,7 +453,7 @@ def main(): sys.exit('Cannot connect to the server due to ' + str(e)) try: # Use the RPC directly so older servers are supported - result = api.Backend.rpcclient.forward( + api.Backend.rpcclient.forward( 'automountlocation_show', ipautil.fsdecode(options.location), version=u'2.0', diff --git a/client/ipa-client-install b/client/ipa-client-install index d38eaf951..da7d6b37d 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -72,8 +72,6 @@ error was: """ % e, file=sys.stderr) sys.exit(1) -# pylint: disable=unused-variable - SUCCESS = 0 CLIENT_INSTALL_ERROR = 1 CLIENT_NOT_CONFIGURED = 2 @@ -97,7 +95,7 @@ def parse_options(): initialized = nss.nss_is_initialized() try: cert = x509.load_certificate_from_file(value) - except Exception as e: + except Exception: raise OptionValueError("%s option '%s' is not a valid certificate file" % (opt, value)) else: del(cert) @@ -230,7 +228,7 @@ def parse_options(): "be run with --unattended option") parser.add_option_group(uninstall_group) - options, args = parser.parse_args() + options, _args = parser.parse_args() safe_opts = parser.get_safe_opts(options) if (options.server and not options.domain): @@ -383,7 +381,6 @@ def nssldap_exists(): # helper function for uninstall # deletes IPA domain from sssd.conf def delete_ipa_domain(): - sssd = services.service('sssd') try: sssdconfig = SSSDConfig.SSSDConfig() sssdconfig.import_config() @@ -1509,7 +1506,7 @@ def configure_nisdomain(options, domain): try: result = ipautil.run([paths.BIN_NISDOMAINNAME], capture_output=True) - except CalledProcessError as e: + except CalledProcessError: pass else: nis_domain_name = result.output @@ -1748,7 +1745,7 @@ def verify_dns_update(fqdn, ips): def get_server_connection_interface(server): # connect to IPA server, get all ip addresses of inteface used to connect for res in socket.getaddrinfo(server, 389, socket.AF_UNSPEC, socket.SOCK_STREAM): - (af, socktype, proto, canonname, sa) = res + af, socktype, proto, _canonname, sa = res try: s = socket.socket(af, socktype, proto) except socket.error as e: @@ -1923,7 +1920,7 @@ def get_ca_certs_from_file(url): root_logger.debug("trying to retrieve CA cert from file %s", filename) try: certs = x509.load_certificate_list_from_file(filename) - except Exception as e: + except Exception: raise errors.NoCertificateError(entry=filename) return certs @@ -1944,7 +1941,7 @@ def get_ca_certs_from_http(url, warn=True): try: result = run([paths.BIN_CURL, "-o", "-", url], capture_output=True) - except CalledProcessError as e: + except CalledProcessError: raise errors.NoCertificateError(entry=url) stdout = result.output @@ -2981,7 +2978,7 @@ def install(options, env, fstore, statestore): if nslcd.is_installed(): save_state(nslcd) - retcode, conf, filename = (0, None, None) + retcode, conf = (0, None) if not options.no_ac: # Modify nsswitch/pam stack |