diff options
author | Martin Basti <mbasti@redhat.com> | 2016-10-04 20:02:32 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-10-06 10:43:36 +0200 |
commit | 135047d03c1780d682998369aaa531585b39a069 (patch) | |
tree | 13dfe4637a7f264bcc911b7bc1f36a8662ee1762 /ipaserver/plugins/dogtag.py | |
parent | d9375881460d63cdd696bb0705da0ac205db9870 (diff) | |
download | freeipa-135047d03c1780d682998369aaa531585b39a069.tar.gz freeipa-135047d03c1780d682998369aaa531585b39a069.tar.xz freeipa-135047d03c1780d682998369aaa531585b39a069.zip |
Pylint: remove unused variables in ipaserver package
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipaserver/plugins/dogtag.py')
-rw-r--r-- | ipaserver/plugins/dogtag.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py index d7f86736a..0bdb4daf2 100644 --- a/ipaserver/plugins/dogtag.py +++ b/ipaserver/plugins/dogtag.py @@ -259,8 +259,6 @@ if api.env.in_server: import pki.crypto as cryptoutil from pki.kra import KRAClient -# pylint: disable=unused-variable - if six.PY3: unicode = str @@ -1162,7 +1160,7 @@ def host_has_service(host, ldap2, service='CA'): } query_filter = ldap2.make_filter(filter_attrs, rules='&') try: - ent, trunc = ldap2.find_entries(filter=query_filter, base_dn=base_dn) + ent, _trunc = ldap2.find_entries(filter=query_filter, base_dn=base_dn) if len(ent): return True except Exception: @@ -1186,7 +1184,7 @@ def select_any_master(ldap2, service='CA'): 'ipaConfigString': 'enabledService',} query_filter = ldap2.make_filter(filter_attrs, rules='&') try: - ent, trunc = ldap2.find_entries(filter=query_filter, base_dn=base_dn) + ent, _trunc = ldap2.find_entries(filter=query_filter, base_dn=base_dn) if len(ent): entry = random.choice(ent) return entry.dn[1].value @@ -1285,7 +1283,7 @@ class RestClient(Backend): """Log into the REST API""" if self.cookie is not None: return - status, resp_headers, resp_body = dogtag.https_request( + status, resp_headers, _resp_body = dogtag.https_request( self.ca_host, self.override_port or self.env.ca_agent_port, '/ca/rest/account/login', self.sec_dir, self.password, self.ipa_certificate_nickname, @@ -1485,11 +1483,12 @@ class ra(rabase.rabase, RestClient): self.debug('%s.check_request_status()', type(self).__name__) # Call CMS - http_status, http_headers, http_body = \ + http_status, _http_headers, http_body = ( self._request('/ca/ee/ca/checkRequest', self.env.ca_port, requestId=request_id, xml='true') + ) # Parse and handle errors if http_status != 200: @@ -1570,11 +1569,12 @@ class ra(rabase.rabase, RestClient): serial_number = int(serial_number, 0) # Call CMS - http_status, http_headers, http_body = \ + http_status, _http_headers, http_body = ( self._sslget('/ca/agent/ca/displayBySerial', self.env.ca_agent_port, serialNumber=str(serial_number), xml='true') + ) # Parse and handle errors @@ -1654,7 +1654,7 @@ class ra(rabase.rabase, RestClient): if ca_id: path += '?issuer-id={}'.format(ca_id) - http_status, http_headers, http_body = self._ssldo( + _http_status, _http_headers, http_body = self._ssldo( 'POST', path, headers={ 'Content-Type': 'application/xml', @@ -1728,7 +1728,7 @@ class ra(rabase.rabase, RestClient): serial_number = int(serial_number, 0) # Call CMS - http_status, http_headers, http_body = \ + http_status, _http_headers, http_body = \ self._sslget('/ca/agent/ca/doRevoke', self.env.ca_agent_port, op='revoke', @@ -1788,11 +1788,12 @@ class ra(rabase.rabase, RestClient): serial_number = int(serial_number, 0) # Call CMS - http_status, http_headers, http_body = \ + http_status, _http_headers, http_body = ( self._sslget('/ca/agent/ca/doUnrevoke', self.env.ca_agent_port, serialNumber=str(serial_number), xml='true') + ) # Parse and handle errors if http_status != 200: @@ -2050,7 +2051,7 @@ class ra_certprofile(RestClient): """ Read the profile configuration from Dogtag """ - status, resp_headers, resp_body = self._ssldo( + _status, _resp_headers, resp_body = self._ssldo( 'GET', profile_id + '/raw') return resp_body @@ -2103,7 +2104,7 @@ class ra_lightweight_ca(RestClient): """ assert isinstance(dn, DN) - status, resp_headers, resp_body = self._ssldo( + _status, _resp_headers, resp_body = self._ssldo( 'POST', None, headers={ 'Content-type': 'application/json', @@ -2117,7 +2118,7 @@ class ra_lightweight_ca(RestClient): raise errors.RemoteRetrieveError(reason=_("Response from CA was not valid JSON")) def read_ca(self, ca_id): - status, resp_headers, resp_body = self._ssldo( + _status, _resp_headers, resp_body = self._ssldo( 'GET', ca_id, headers={'Accept': 'application/json'}) try: return json.loads(resp_body) |