diff --git a/keystoneauth1/adapter.py b/keystoneauth1/adapter.py index 034a7a5c..b2d92fb4 100644 --- a/keystoneauth1/adapter.py +++ b/keystoneauth1/adapter.py @@ -195,7 +195,6 @@ class Adapter(object): :type parser: argparse.ArgumentParser :param str service_type: Default service_type value. (optional) """ - adapter_group = parser.add_argument_group( 'Service Options', 'Options controlling the specialization of the API' diff --git a/keystoneauth1/discover.py b/keystoneauth1/discover.py index 63900bb8..b60a198f 100644 --- a/keystoneauth1/discover.py +++ b/keystoneauth1/discover.py @@ -72,7 +72,6 @@ def get_version_data(session, url, authenticated=None): def normalize_version_number(version): """Turn a version representation into a tuple.""" - # trim the v from a 'v2.0' or similar try: version = version.lstrip('v') diff --git a/keystoneauth1/extras/_saml2/v3/adfs.py b/keystoneauth1/extras/_saml2/v3/adfs.py index df792aa8..ab2b9166 100644 --- a/keystoneauth1/extras/_saml2/v3/adfs.py +++ b/keystoneauth1/extras/_saml2/v3/adfs.py @@ -73,7 +73,6 @@ class Password(base.BaseSAMLPlugin): :type password: string """ - super(Password, self).__init__( auth_url=auth_url, identity_provider=identity_provider, identity_provider_url=identity_provider_url, @@ -117,7 +116,6 @@ class Password(base.BaseSAMLPlugin): :type fmt: string """ - date_created = datetime.datetime.utcnow() date_expires = date_created + datetime.timedelta( seconds=self.DEFAULT_ADFS_TOKEN_EXPIRATION) @@ -129,7 +127,6 @@ class Password(base.BaseSAMLPlugin): Some values like username or password are inserted in the request. """ - WSS_SECURITY_NAMESPACE = { 'o': ('http://docs.oasis-open.org/wss/2004/01/oasis-200401-' 'wss-wssecurity-secext-1.0.xsd') diff --git a/keystoneauth1/extras/_saml2/v3/saml2.py b/keystoneauth1/extras/_saml2/v3/saml2.py index 543ecb49..8902a299 100644 --- a/keystoneauth1/extras/_saml2/v3/saml2.py +++ b/keystoneauth1/extras/_saml2/v3/saml2.py @@ -199,7 +199,6 @@ class Password(base.BaseSAMLPlugin): def _send_idp_saml2_authn_request(self, session): """Present modified SAML2 authn assertion from the Service Provider.""" - self._prepare_idp_saml2_request(self.saml2_authn_request) idp_saml2_authn_request = self.saml2_authn_request diff --git a/keystoneauth1/identity/v3/k2k.py b/keystoneauth1/identity/v3/k2k.py index 5e34f78f..655bb63b 100644 --- a/keystoneauth1/identity/v3/k2k.py +++ b/keystoneauth1/identity/v3/k2k.py @@ -140,7 +140,6 @@ class Keystone2Keystone(federation._Rescoped): :type sp_auth_url: str """ - response = session.post( sp_url, headers={'Content-Type': 'application/vnd.paos+xml'}, diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index 349d6658..49bbe504 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -183,7 +183,6 @@ class OidcPassword(_OidcBase): :returns: a token data representation :rtype: :py:class:`keystoneauth1.access.AccessInfoV3` """ - # get an access token client_auth = (self.client_id, self.client_secret) payload = {'grant_type': self.grant_type, 'username': self.username, @@ -250,7 +249,6 @@ class OidcAuthorizationCode(_OidcBase): :returns: a token data representation :rtype: :py:class:`keystoneauth1.access.AccessInfoV3` """ - # get an access token client_auth = (self.client_id, self.client_secret) payload = {'grant_type': self.grant_type, diff --git a/keystoneauth1/session.py b/keystoneauth1/session.py index fc1f71e2..40974d90 100644 --- a/keystoneauth1/session.py +++ b/keystoneauth1/session.py @@ -362,7 +362,6 @@ class Session(object): :returns: The response to the request. """ - headers = kwargs.setdefault('headers', dict()) if authenticated is None: diff --git a/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.py b/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.py index bb820ddf..bb1a90ec 100644 --- a/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.py +++ b/keystoneauth1/tests/unit/extras/saml2/test_auth_adfs.py @@ -82,7 +82,6 @@ class AuthenticateviaADFSTests(utils.TestCase): def test_get_adfs_security_token(self): """Test ADFSPassword._get_adfs_security_token().""" - self.requests_mock.post( self.IDENTITY_PROVIDER_URL, content=utils.make_oneline(self.ADFS_SECURITY_TOKEN_RESPONSE), diff --git a/keystoneauth1/tests/unit/identity/test_identity_v3_oidc.py b/keystoneauth1/tests/unit/identity/test_identity_v3_oidc.py index cab7fbf2..9f84dc59 100644 --- a/keystoneauth1/tests/unit/identity/test_identity_v3_oidc.py +++ b/keystoneauth1/tests/unit/identity/test_identity_v3_oidc.py @@ -68,7 +68,6 @@ class OIDCPasswordTests(AuthenticateOIDCTests): def test_initial_call_to_get_access_token(self): """Test initial call, expect JSON access token.""" - # Mock the output that creates the access token self.requests_mock.post( self.ACCESS_TOKEN_ENDPOINT, @@ -93,7 +92,6 @@ class OIDCPasswordTests(AuthenticateOIDCTests): def test_second_call_to_protected_url(self): """Test subsequent call, expect Keystone token.""" - # Mock the output that creates the keystone token self.requests_mock.post( self.FEDERATION_AUTH_URL, @@ -115,7 +113,6 @@ class OIDCPasswordTests(AuthenticateOIDCTests): def test_end_to_end_workflow(self): """Test full OpenID Connect workflow.""" - # Mock the output that creates the access token self.requests_mock.post( self.ACCESS_TOKEN_ENDPOINT, @@ -135,7 +132,6 @@ class OIDCAuthorizationGrantTests(AuthenticateOIDCTests): def test_initial_call_to_get_access_token(self): """Test initial call, expect JSON access token.""" - # Mock the output that creates the access token self.requests_mock.post( self.ACCESS_TOKEN_ENDPOINT, diff --git a/keystoneauth1/tests/unit/matchers.py b/keystoneauth1/tests/unit/matchers.py index 6076f348..01c98779 100644 --- a/keystoneauth1/tests/unit/matchers.py +++ b/keystoneauth1/tests/unit/matchers.py @@ -41,7 +41,6 @@ class XMLEquals(object): different children. """ - if expected_doc.tag != observed_doc.tag: return False diff --git a/keystoneauth1/tests/unit/test_session.py b/keystoneauth1/tests/unit/test_session.py index 508c56a3..67be1358 100644 --- a/keystoneauth1/tests/unit/test_session.py +++ b/keystoneauth1/tests/unit/test_session.py @@ -176,7 +176,6 @@ class SessionTests(utils.TestCase): def test_logs_failed_output(self): """Test that output is logged even for failed requests""" - session = client_session.Session() body = uuid.uuid4().hex diff --git a/tox.ini b/tox.ini index 0b8a2c79..de6b74a3 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,6 @@ commands = oslo_debug_helper -t keystoneauth1/tests {posargs} # D104: Missing docstring in public package # D105: Missing docstring in magic method # D200: One-line docstring should fit on one line with quotes -# D202: No blank lines allowed after function docstring # D203: 1 blank required before class docstring. # D204: 1 blank required after class docstring # D205: Blank line required between one-line summary and description. @@ -46,7 +45,7 @@ commands = oslo_debug_helper -t keystoneauth1/tests {posargs} # D301: Use r”“” if any backslashes in a docstring # D400: First line should end with a period. # D401: First line should be in imperative mood. -ignore = H405,D100,D101,D102,D103,D104,D105,D200,D202,D203,D204,D205,D208,D211,D301,D400,D401 +ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301,D400,D401 show-source = True exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*