Fix E12x warnings found by Pep8 1.4.6

These are missed due to bugs in 1.4.5.

Closes-Bug: #1267994
Change-Id: Ic7b37abf757a9b7b0c8306c941949dee93b83e08
This commit is contained in:
Dirk Mueller
2013-10-17 21:38:51 +02:00
parent 92c9f03f36
commit fc1f75aa51
5 changed files with 68 additions and 63 deletions

View File

@@ -241,8 +241,8 @@ class OpenStackIdentityShell(object):
"determine whether a token has expired " "determine whether a token has expired "
"when retrieving it from keyring. This " "when retrieving it from keyring. This "
"is useful in mitigating process or " "is useful in mitigating process or "
"network delays. Default is %s seconds." % ( "network delays. Default is %s seconds." %
access.STALE_TOKEN_DURATION)) access.STALE_TOKEN_DURATION)
return parser return parser

View File

@@ -146,8 +146,8 @@ class ManagerTest(utils.TestCase):
self.client.patch = self.mox.CreateMockAnything() self.client.patch = self.mox.CreateMockAnything()
self.client.put = self.mox.CreateMockAnything() self.client.put = self.mox.CreateMockAnything()
self.client.patch( self.client.patch(
self.url, body=self.body, management=False).AndReturn( self.url, body=self.body, management=False).AndReturn((None,
(None, self.body)) self.body))
self.client.put(self.url, body=None, management=True).AndReturn( self.client.put(self.url, body=None, management=True).AndReturn(
(None, self.body)) (None, self.body))
self.mox.ReplayAll() self.mox.ReplayAll()

View File

@@ -27,49 +27,53 @@ UNSCOPED_TOKEN = {
} }
} }
_TENANT_ID = '225da22d3ce34b15877ea70b2a575f58'
PROJECT_SCOPED_TOKEN = { PROJECT_SCOPED_TOKEN = {
'access': { 'access': {
'serviceCatalog': [{ 'serviceCatalog': [{
'endpoints': [{ 'endpoints': [{
'adminURL': 'http://admin:8776/v1/225da22d3ce34b15877ea70b2a575f58', 'adminURL': 'http://admin:8776/v1/%s' % _TENANT_ID,
'internalURL': 'internalURL': 'http://internal:8776/v1/%s' % _TENANT_ID,
'http://internal:8776/v1/225da22d3ce34b15877ea70b2a575f58', 'publicURL': 'http://public.com:8776/v1/%s' % _TENANT_ID,
'publicURL': 'region': 'RegionOne'
'http://public.com:8776/v1/225da22d3ce34b15877ea70b2a575f58',
'region': 'RegionOne'
}], }],
'endpoints_links': [], 'endpoints_links': [],
'name': 'Volume Service', 'name': 'Volume Service',
'type': 'volume'}, 'type': 'volume'},
{'endpoints': [{ {'endpoints': [{
'adminURL': 'http://admin:9292/v1', 'adminURL': 'http://admin:9292/v1',
'internalURL': 'http://internal:9292/v1', 'internalURL': 'http://internal:9292/v1',
'publicURL': 'http://public.com:9292/v1', 'publicURL': 'http://public.com:9292/v1',
'region': 'RegionOne'}], 'region': 'RegionOne'
}],
'endpoints_links': [], 'endpoints_links': [],
'name': 'Image Service', 'name': 'Image Service',
'type': 'image'}, 'type': 'image'},
{'endpoints': [{ {'endpoints': [{
'adminURL': 'http://admin:8774/v2/225da22d3ce34b15877ea70b2a575f58', 'adminURL': 'http://admin:8774/v2/%s' % _TENANT_ID,
'internalURL': 'http://internal:8774/v2/225da22d3ce34b15877ea70b2a575f58', 'internalURL': 'http://internal:8774/v2/%s' % _TENANT_ID,
'publicURL': 'http://public.com:8774/v2/225da22d3ce34b15877ea70b2a575f58', 'publicURL': 'http://public.com:8774/v2/%s' % _TENANT_ID,
'region': 'RegionOne'}], 'region': 'RegionOne'
}],
'endpoints_links': [], 'endpoints_links': [],
'name': 'Compute Service', 'name': 'Compute Service',
'type': 'compute'}, 'type': 'compute'},
{'endpoints': [{ {'endpoints': [{
'adminURL': 'http://admin:8773/services/Admin', 'adminURL': 'http://admin:8773/services/Admin',
'internalURL': 'http://internal:8773/services/Cloud', 'internalURL': 'http://internal:8773/services/Cloud',
'publicURL': 'http://public.com:8773/services/Cloud', 'publicURL': 'http://public.com:8773/services/Cloud',
'region': 'RegionOne'}], 'region': 'RegionOne'
}],
'endpoints_links': [], 'endpoints_links': [],
'name': 'EC2 Service', 'name': 'EC2 Service',
'type': 'ec2'}, 'type': 'ec2'},
{'endpoints': [{ {'endpoints': [{
'adminURL': 'http://admin:35357/v2.0', 'adminURL': 'http://admin:35357/v2.0',
'internalURL': 'http://internal:5000/v2.0', 'internalURL': 'http://internal:5000/v2.0',
'publicURL': 'http://public.com:5000/v2.0', 'publicURL': 'http://public.com:5000/v2.0',
'region': 'RegionOne'}], 'region': 'RegionOne'
}],
'endpoints_links': [], 'endpoints_links': [],
'name': 'Identity Service', 'name': 'Identity Service',
'type': 'identity'}], 'type': 'identity'}],

View File

@@ -99,7 +99,7 @@ class FakeHTTPClient(fakes.FakeClient):
{"tenantId": "1", {"tenantId": "1",
"id": "3", "id": "3",
"name": "Member"}], "name": "Member"}],
"name": "joeuser"}} "name": "joeuser"}}
} }
] ]
return (200, body) return (200, body)
@@ -116,11 +116,10 @@ class FakeHTTPClient(fakes.FakeClient):
{"name": "joeuser", {"name": "joeuser",
"tenantName": "customer-x", "tenantName": "customer-x",
"id": "1", "id": "1",
"roles": [ "roles": [{"serviceId": "1",
{"serviceId": "1", "id": "3",
"id": "3", "name": "Member"}],
"name": "Member"}], "tenantId": "1"}}
"tenantId": "1"}}
} }
] ]
return (200, body) return (200, body)
@@ -183,28 +182,30 @@ class FakeHTTPClient(fakes.FakeClient):
def get(self, **kw): def get(self, **kw):
body = { body = {
"version": { "version": {
"id": "v2.0", "id": "v2.0",
"status": "beta", "status": "beta",
"updated": "2011-11-19T00:00:00Z", "updated": "2011-11-19T00:00:00Z",
"links": [ "links": [
{"rel": "self", {"rel": "self",
"href": "http://127.0.0.1:35357/v2.0/"}, "href": "http://127.0.0.1:35357/v2.0/"},
{"rel": "describedby", {"rel": "describedby",
"type": "text/html", "type": "text/html",
"href": "http://docs.openstack.org/" "href": "http://docs.openstack.org/"
"api/openstack-identity-service/2.0/content/"}, "api/openstack-identity-service/2.0/content/"},
{"rel": "describedby", {"rel": "describedby",
"type": "application/pdf", "type": "application/pdf",
"href": "http://docs.openstack.org/api/" "href": "http://docs.openstack.org/api/"
"openstack-identity-service/2.0/identity-dev-guide-2.0.pdf"}, "openstack-identity-service/2.0/"
{"rel": "describedby", "identity-dev-guide-2.0.pdf"},
"type": "application/vnd.sun.wadl+xml", {"rel": "describedby",
"href": "http://127.0.0.1:35357/v2.0/identity-admin.wadl"}], "type": "application/vnd.sun.wadl+xml",
"media-types": [ "href":
{"base": "application/xml", "http://127.0.0.1:35357/v2.0/identity-admin.wadl"}],
"type": "application/vnd.openstack.identity-v2.0+xml"}, "media-types": [
{"base": "application/json", {"base": "application/xml",
"type": "application/vnd.openstack.identity-v2.0+json"}] "type": "application/vnd.openstack.identity-v2.0+xml"},
{"base": "application/json",
"type": "application/vnd.openstack.identity-v2.0+json"}]
} }
} }
return (200, body) return (200, body)
@@ -418,14 +419,14 @@ class FakeHTTPClient(fakes.FakeClient):
def get_OS_KSADM_services(self, **kw): def get_OS_KSADM_services(self, **kw):
body = { body = {
"OS-KSADM:services": [ "OS-KSADM:services": [
{"description": None, {"description": None,
"type": "compute", "type": "compute",
"id": "1", "id": "1",
"name": "service1"}, "name": "service1"},
{"description": None, {"description": None,
"type": "identity", "type": "identity",
"id": "2", "id": "2",
"name": "service2"}] "name": "service2"}]
} }
return (200, body) return (200, body)

View File

@@ -70,7 +70,7 @@ class RoleTests(utils.TestCase, utils.CrudTests):
self.stub_entity(httpretty.GET, self.stub_entity(httpretty.GET,
['domains', domain_id, 'users', user_id, ['domains', domain_id, 'users', user_id,
self.collection_key], entity=ref_list) self.collection_key], entity=ref_list)
self.manager.list(domain=domain_id, user=user_id) self.manager.list(domain=domain_id, user=user_id)