diff options
author | Martin Basti <mbasti@redhat.com> | 2016-09-26 14:08:17 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-09-27 13:35:58 +0200 |
commit | 0f88f8fe889ae4801fc8d5ece1ad51c5246718ac (patch) | |
tree | 4f38fb6210abaa9f354353df2abda96d1b8fb612 /ipapython | |
parent | 452b08754d02b89c0e3117b83d9156e6110943c9 (diff) | |
download | freeipa-0f88f8fe889ae4801fc8d5ece1ad51c5246718ac.tar.gz freeipa-0f88f8fe889ae4801fc8d5ece1ad51c5246718ac.tar.xz freeipa-0f88f8fe889ae4801fc8d5ece1ad51c5246718ac.zip |
Remove unused variables in the code
This commit removes unused variables or rename variables as "expected to
be unused" by using "_" prefix.
This covers only cases where fix was easy or only one unused variable
was in a module
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/dn.py | 9 | ||||
-rw-r--r-- | ipapython/dogtag.py | 2 | ||||
-rw-r--r-- | ipapython/graph.py | 4 | ||||
-rw-r--r-- | ipapython/install/cli.py | 2 | ||||
-rw-r--r-- | ipapython/install/common.py | 4 | ||||
-rw-r--r-- | ipapython/nsslib.py | 2 |
6 files changed, 11 insertions, 12 deletions
diff --git a/ipapython/dn.py b/ipapython/dn.py index 4ba741e2f..3ee35c626 100644 --- a/ipapython/dn.py +++ b/ipapython/dn.py @@ -1186,9 +1186,10 @@ class DN(object): # differ in case must yield the same hash value. str_dn = ';,'.join([ - '++'.join( - ['=='.join((atype, avalue or '')) for atype,avalue,dummy in rdn] - ) for rdn in self.rdns + '++'.join([ + '=='.join((atype, avalue or '')) + for atype, avalue, _dummy in rdn + ]) for rdn in self.rdns ]) return hash(str_dn.lower()) @@ -1225,9 +1226,7 @@ class DN(object): def _cmp_sequence(self, pattern, self_start, pat_len): self_idx = self_start - self_len = len(self) pat_idx = 0 - # and self_idx < self_len while pat_idx < pat_len: r = cmp_rdns(self.rdns[self_idx], pattern.rdns[pat_idx]) if r != 0: diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py index 6f1388002..179ce6d68 100644 --- a/ipapython/dogtag.py +++ b/ipapython/dogtag.py @@ -113,7 +113,7 @@ def ca_status(ca_host=None): """ if ca_host is None: ca_host = api.env.ca_host - status, headers, body = http_request( + status, _headers, body = http_request( ca_host, 8080, '/ca/admin/ca/getStatus') if status == 503: # Service temporarily unavailable diff --git a/ipapython/graph.py b/ipapython/graph.py index 0e06a0831..6b31c915c 100644 --- a/ipapython/graph.py +++ b/ipapython/graph.py @@ -44,8 +44,8 @@ class Graph(object): # delete _adjacencies del self._adj[vertex] - for key, _adj in self._adj.items(): - _adj[:] = [v for v in _adj if v != vertex] + for adj in self._adj.values(): + adj[:] = [v for v in adj if v != vertex] # delete edges edges = [e for e in self.edges if e[0] != vertex and e[1] != vertex] diff --git a/ipapython/install/cli.py b/ipapython/install/cli.py index 9cd9ec768..39c4c4491 100644 --- a/ipapython/install/cli.py +++ b/ipapython/install/cli.py @@ -152,7 +152,7 @@ class ConfigureTool(admintool.AdminTool): **kwargs ) - for group, opt_group in groups.items(): + for opt_group in groups.values(): parser.add_option_group(opt_group) super(ConfigureTool, cls).add_options(parser, diff --git a/ipapython/install/common.py b/ipapython/install/common.py index fc8e33291..42890374a 100644 --- a/ipapython/install/common.py +++ b/ipapython/install/common.py @@ -60,7 +60,7 @@ class Step(Installable): raise AttributeError('parent') def _install(self): - for nothing in self._installer(self.parent): + for _nothing in self._installer(self.parent): yield from_(super(Step, self)._install()) @staticmethod @@ -68,7 +68,7 @@ class Step(Installable): yield def _uninstall(self): - for nothing in self._uninstaller(self.parent): + for _nothing in self._uninstaller(self.parent): yield from_(super(Step, self)._uninstall()) @staticmethod diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index 1573de96f..f9f64c193 100644 --- a/ipapython/nsslib.py +++ b/ipapython/nsslib.py @@ -234,7 +234,7 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback): self.sock.set_ssl_option(ssl.SSL_HANDSHAKE_AS_CLIENT, True) try: self.sock.set_ssl_version_range(self.tls_version_min, self.tls_version_max) - except NSPRError as e: + except NSPRError: root_logger.error('Failed to set TLS range to %s, %s' % (self.tls_version_min, self.tls_version_max)) raise self.sock.set_ssl_option(ssl_require_safe_negotiation, False) |