Merge "Using dict.items() is better than six.iteritems(dict)"
This commit is contained in:
commit
5b482c33b3
@ -178,7 +178,7 @@ class SecretACLsController(controllers.ACLMixin):
|
|||||||
self.acl_repo.create_or_replace_from(self.secret, secret_acl=s_acl,
|
self.acl_repo.create_or_replace_from(self.secret, secret_acl=s_acl,
|
||||||
user_ids=user_ids)
|
user_ids=user_ids)
|
||||||
# delete remaining existing acls as they are not present in input.
|
# delete remaining existing acls as they are not present in input.
|
||||||
for acl in six.itervalues(existing_acls_map):
|
for acl in existing_acls_map.values():
|
||||||
self.acl_repo.delete_entity_by_id(entity_id=acl.id,
|
self.acl_repo.delete_entity_by_id(entity_id=acl.id,
|
||||||
external_project_id=None)
|
external_project_id=None)
|
||||||
acl_ref = '{0}/acl'.format(
|
acl_ref = '{0}/acl'.format(
|
||||||
@ -347,7 +347,7 @@ class ContainerACLsController(controllers.ACLMixin):
|
|||||||
container_acl=c_acl,
|
container_acl=c_acl,
|
||||||
user_ids=user_ids)
|
user_ids=user_ids)
|
||||||
# delete remaining existing acls as they are not present in input.
|
# delete remaining existing acls as they are not present in input.
|
||||||
for acl in six.itervalues(existing_acls_map):
|
for acl in existing_acls_map.values():
|
||||||
self.acl_repo.delete_entity_by_id(entity_id=acl.id,
|
self.acl_repo.delete_entity_by_id(entity_id=acl.id,
|
||||||
external_project_id=None)
|
external_project_id=None)
|
||||||
acl_ref = '{0}/acl'.format(
|
acl_ref = '{0}/acl'.format(
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import pecan
|
import pecan
|
||||||
import six
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from barbican.api import controllers
|
from barbican.api import controllers
|
||||||
@ -134,7 +133,7 @@ class VersionsController(object):
|
|||||||
return {'build': version.__version__}
|
return {'build': version.__version__}
|
||||||
|
|
||||||
versions_info = [version_class.get_version_info(pecan.request) for
|
versions_info = [version_class.get_version_info(pecan.request) for
|
||||||
version_class in six.itervalues(AVAILABLE_VERSIONS)]
|
version_class in AVAILABLE_VERSIONS.values()]
|
||||||
|
|
||||||
version_output = {
|
version_output = {
|
||||||
'versions': {
|
'versions': {
|
||||||
|
@ -22,7 +22,6 @@ import mimetypes
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
import pecan
|
import pecan
|
||||||
import six
|
|
||||||
from testtools import testcase
|
from testtools import testcase
|
||||||
import webtest
|
import webtest
|
||||||
|
|
||||||
@ -382,7 +381,7 @@ class WhenGettingPuttingOrDeletingSecretUsingSecretResource(FunctionalTest):
|
|||||||
self.assertNotIn('content_encodings', resp.namespace)
|
self.assertNotIn('content_encodings', resp.namespace)
|
||||||
self.assertIn('content_types', resp.namespace)
|
self.assertIn('content_types', resp.namespace)
|
||||||
self.assertIn(self.datum.content_type,
|
self.assertIn(self.datum.content_type,
|
||||||
six.itervalues(resp.namespace['content_types']))
|
resp.namespace['content_types'].values())
|
||||||
self.assertNotIn('mime_type', resp.namespace)
|
self.assertNotIn('mime_type', resp.namespace)
|
||||||
|
|
||||||
@testcase.attr('deprecated')
|
@testcase.attr('deprecated')
|
||||||
@ -529,7 +528,7 @@ class WhenGettingPuttingOrDeletingSecretUsingSecretResource(FunctionalTest):
|
|||||||
self.assertIsNotNone(resp.namespace)
|
self.assertIsNotNone(resp.namespace)
|
||||||
self.assertIn('content_types', resp.namespace)
|
self.assertIn('content_types', resp.namespace)
|
||||||
self.assertIn(self.datum.content_type,
|
self.assertIn(self.datum.content_type,
|
||||||
six.itervalues(resp.namespace['content_types']))
|
resp.namespace['content_types'].values())
|
||||||
|
|
||||||
@mock.patch('barbican.plugin.resources.get_transport_key_id_for_retrieval')
|
@mock.patch('barbican.plugin.resources.get_transport_key_id_for_retrieval')
|
||||||
def test_should_get_secret_meta_for_binary_with_tkey(
|
def test_should_get_secret_meta_for_binary_with_tkey(
|
||||||
@ -556,7 +555,7 @@ class WhenGettingPuttingOrDeletingSecretUsingSecretResource(FunctionalTest):
|
|||||||
self.assertIsNotNone(resp.namespace)
|
self.assertIsNotNone(resp.namespace)
|
||||||
self.assertIn('content_types', resp.namespace)
|
self.assertIn('content_types', resp.namespace)
|
||||||
self.assertIn(self.datum.content_type,
|
self.assertIn(self.datum.content_type,
|
||||||
six.itervalues(resp.namespace['content_types']))
|
resp.namespace['content_types'].values())
|
||||||
self.assertIn('transport_key_ref', resp.namespace)
|
self.assertIn('transport_key_ref', resp.namespace)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
hrefs.convert_transport_key_to_href(self.transport_key_id),
|
hrefs.convert_transport_key_to_href(self.transport_key_id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user