Fixed a bunch of spacing
Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
This commit is contained in:
		| @@ -37,6 +37,7 @@ USER_AGENT = 'python-openstackclient' | |||||||
|  |  | ||||||
| class ClientCache(object): | class ClientCache(object): | ||||||
|     """Descriptor class for caching created client handles.""" |     """Descriptor class for caching created client handles.""" | ||||||
|  |  | ||||||
|     def __init__(self, factory): |     def __init__(self, factory): | ||||||
|         self.factory = factory |         self.factory = factory | ||||||
|         self._handle = None |         self._handle = None | ||||||
|   | |||||||
| @@ -22,6 +22,7 @@ import six | |||||||
|  |  | ||||||
|  |  | ||||||
| class CommandMeta(abc.ABCMeta): | class CommandMeta(abc.ABCMeta): | ||||||
|  |  | ||||||
|     def __new__(mcs, name, bases, cls_dict): |     def __new__(mcs, name, bases, cls_dict): | ||||||
|         if 'log' not in cls_dict: |         if 'log' not in cls_dict: | ||||||
|             cls_dict['log'] = logging.getLogger( |             cls_dict['log'] = logging.getLogger( | ||||||
|   | |||||||
| @@ -41,6 +41,7 @@ class UnsupportedVersion(Exception): | |||||||
|  |  | ||||||
| class ClientException(Exception): | class ClientException(Exception): | ||||||
|     """The base exception class for all exceptions this library raises.""" |     """The base exception class for all exceptions this library raises.""" | ||||||
|  |  | ||||||
|     def __init__(self, code, message=None, details=None): |     def __init__(self, code, message=None, details=None): | ||||||
|         self.code = code |         self.code = code | ||||||
|         self.message = message or self.__class__.message |         self.message = message or self.__class__.message | ||||||
|   | |||||||
| @@ -169,7 +169,7 @@ class ShowQuota(command.ShowOne): | |||||||
|         project = utils.find_resource( |         project = utils.find_resource( | ||||||
|             identity_client.projects, |             identity_client.projects, | ||||||
|             parsed_args.project, |             parsed_args.project, | ||||||
|             ).id |         ).id | ||||||
|  |  | ||||||
|         try: |         try: | ||||||
|             if parsed_args.quota_class: |             if parsed_args.quota_class: | ||||||
| @@ -193,7 +193,7 @@ class ShowQuota(command.ShowOne): | |||||||
|             project = utils.find_resource( |             project = utils.find_resource( | ||||||
|                 identity_client.projects, |                 identity_client.projects, | ||||||
|                 parsed_args.project, |                 parsed_args.project, | ||||||
|                 ).id |             ).id | ||||||
|             return self.app.client_manager.network.get_quota(project) |             return self.app.client_manager.network.get_quota(project) | ||||||
|         else: |         else: | ||||||
|             return {} |             return {} | ||||||
|   | |||||||
| @@ -149,20 +149,20 @@ class ListFlavor(command.Lister): | |||||||
|             action="store_true", |             action="store_true", | ||||||
|             default=True, |             default=True, | ||||||
|             help="List only public flavors (default)", |             help="List only public flavors (default)", | ||||||
|             ) |         ) | ||||||
|         public_group.add_argument( |         public_group.add_argument( | ||||||
|             "--private", |             "--private", | ||||||
|             dest="public", |             dest="public", | ||||||
|             action="store_false", |             action="store_false", | ||||||
|             help="List only private flavors", |             help="List only private flavors", | ||||||
|             ) |         ) | ||||||
|         public_group.add_argument( |         public_group.add_argument( | ||||||
|             "--all", |             "--all", | ||||||
|             dest="all", |             dest="all", | ||||||
|             action="store_true", |             action="store_true", | ||||||
|             default=False, |             default=False, | ||||||
|             help="List all flavors, whether public or private", |             help="List all flavors, whether public or private", | ||||||
|             ) |         ) | ||||||
|         parser.add_argument( |         parser.add_argument( | ||||||
|             '--long', |             '--long', | ||||||
|             action='store_true', |             action='store_true', | ||||||
|   | |||||||
| @@ -53,7 +53,7 @@ def make_client(instance): | |||||||
|         session=instance.session, |         session=instance.session, | ||||||
|         region_name=instance._region_name, |         region_name=instance._region_name, | ||||||
|         **kwargs |         **kwargs | ||||||
|         ) |     ) | ||||||
|  |  | ||||||
|     return client |     return client | ||||||
|  |  | ||||||
| @@ -72,6 +72,7 @@ def build_option_parser(parser): | |||||||
|  |  | ||||||
| class IdentityClientv2(identity_client_v2.Client): | class IdentityClientv2(identity_client_v2.Client): | ||||||
|     """Tweak the earlier client class to deal with some changes""" |     """Tweak the earlier client class to deal with some changes""" | ||||||
|  |  | ||||||
|     def __getattr__(self, name): |     def __getattr__(self, name): | ||||||
|         # Map v3 'projects' back to v2 'tenants' |         # Map v3 'projects' back to v2 'tenants' | ||||||
|         if name == "projects": |         if name == "projects": | ||||||
|   | |||||||
| @@ -134,7 +134,7 @@ class ListRoleAssignment(command.Lister): | |||||||
|             if 'project' in scope: |             if 'project' in scope: | ||||||
|                 if include_names: |                 if include_names: | ||||||
|                     prj = '@'.join([scope['project']['name'], |                     prj = '@'.join([scope['project']['name'], | ||||||
|                                    scope['project']['domain']['name']]) |                                     scope['project']['domain']['name']]) | ||||||
|                     setattr(assignment, 'project', prj) |                     setattr(assignment, 'project', prj) | ||||||
|                 else: |                 else: | ||||||
|                     setattr(assignment, 'project', scope['project']['id']) |                     setattr(assignment, 'project', scope['project']['id']) | ||||||
|   | |||||||
| @@ -27,6 +27,7 @@ UNSCOPED_AUTH_PLUGINS = ['v3unscopedsaml', 'v3unscopedadfs', 'v3oidc'] | |||||||
|  |  | ||||||
| def auth_with_unscoped_saml(func): | def auth_with_unscoped_saml(func): | ||||||
|     """Check the unscoped federated context""" |     """Check the unscoped federated context""" | ||||||
|  |  | ||||||
|     def _decorated(self, parsed_args): |     def _decorated(self, parsed_args): | ||||||
|         auth_plugin_name = self.app.client_manager.auth_plugin_name |         auth_plugin_name = self.app.client_manager.auth_plugin_name | ||||||
|         if auth_plugin_name in UNSCOPED_AUTH_PLUGINS: |         if auth_plugin_name in UNSCOPED_AUTH_PLUGINS: | ||||||
|   | |||||||
| @@ -265,8 +265,8 @@ class CreateImage(command.ShowOne): | |||||||
|             finally: |             finally: | ||||||
|                 # Clean up open files - make sure data isn't a string |                 # Clean up open files - make sure data isn't a string | ||||||
|                 if ('data' in kwargs and hasattr(kwargs['data'], 'close') and |                 if ('data' in kwargs and hasattr(kwargs['data'], 'close') and | ||||||
|                    kwargs['data'] != sys.stdin): |                         kwargs['data'] != sys.stdin): | ||||||
|                         kwargs['data'].close() |                     kwargs['data'].close() | ||||||
|  |  | ||||||
|             info.update(image._info) |             info.update(image._info) | ||||||
|             info['properties'] = utils.format_dict(info.get('properties', {})) |             info['properties'] = utils.format_dict(info.get('properties', {})) | ||||||
| @@ -697,8 +697,8 @@ class SetImage(command.Command): | |||||||
|         finally: |         finally: | ||||||
|             # Clean up open files - make sure data isn't a string |             # Clean up open files - make sure data isn't a string | ||||||
|             if ('data' in kwargs and hasattr(kwargs['data'], 'close') and |             if ('data' in kwargs and hasattr(kwargs['data'], 'close') and | ||||||
|                kwargs['data'] != sys.stdin): |                     kwargs['data'] != sys.stdin): | ||||||
|                     kwargs['data'].close() |                 kwargs['data'].close() | ||||||
|  |  | ||||||
|  |  | ||||||
| class ShowImage(command.ShowOne): | class ShowImage(command.ShowOne): | ||||||
|   | |||||||
| @@ -26,9 +26,9 @@ _formatters = { | |||||||
|     'allowed_address_pairs': utils.format_list_of_dicts, |     'allowed_address_pairs': utils.format_list_of_dicts, | ||||||
|     'binding_profile': utils.format_dict, |     'binding_profile': utils.format_dict, | ||||||
|     'binding_vif_details': utils.format_dict, |     'binding_vif_details': utils.format_dict, | ||||||
|     'dns_assignment':  utils.format_list_of_dicts, |     'dns_assignment': utils.format_list_of_dicts, | ||||||
|     'extra_dhcp_opts': utils.format_list_of_dicts, |     'extra_dhcp_opts': utils.format_list_of_dicts, | ||||||
|     'fixed_ips':  utils.format_list_of_dicts, |     'fixed_ips': utils.format_list_of_dicts, | ||||||
|     'security_groups': utils.format_list, |     'security_groups': utils.format_list, | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -47,6 +47,7 @@ class Container(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeOptions(object): | class FakeOptions(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         for option in auth.OPTIONS_LIST: |         for option in auth.OPTIONS_LIST: | ||||||
|             setattr(self, option.replace('-', '_'), None) |             setattr(self, option.replace('-', '_'), None) | ||||||
| @@ -71,6 +72,7 @@ class TestClientCache(utils.TestCase): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestClientManager(utils.TestCase): | class TestClientManager(utils.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestClientManager, self).setUp() |         super(TestClientManager, self).setUp() | ||||||
|         self.mock = mock.Mock() |         self.mock = mock.Mock() | ||||||
|   | |||||||
| @@ -19,6 +19,7 @@ from openstackclient.tests import utils as test_utils | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeCommand(command.Command): | class FakeCommand(command.Command): | ||||||
|  |  | ||||||
|     def take_action(self, parsed_args): |     def take_action(self, parsed_args): | ||||||
|         pass |         pass | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ from openstackclient.tests import utils | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeCommand(object): | class FakeCommand(object): | ||||||
|  |  | ||||||
|     @classmethod |     @classmethod | ||||||
|     def load(cls): |     def load(cls): | ||||||
|         return cls |         return cls | ||||||
| @@ -48,6 +49,7 @@ class FakeCommandManager(commandmanager.CommandManager): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestCommandManager(utils.TestCase): | class TestCommandManager(utils.TestCase): | ||||||
|  |  | ||||||
|     def test_add_command_group(self): |     def test_add_command_group(self): | ||||||
|         mgr = FakeCommandManager('test') |         mgr = FakeCommandManager('test') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -66,6 +66,7 @@ class TestContext(utils.TestCase): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestFileFormatter(utils.TestCase): | class TestFileFormatter(utils.TestCase): | ||||||
|  |  | ||||||
|     def test_nothing(self): |     def test_nothing(self): | ||||||
|         formatter = logs._FileFormatter() |         formatter = logs._FileFormatter() | ||||||
|         self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s ' |         self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s ' | ||||||
| @@ -93,6 +94,7 @@ class TestFileFormatter(utils.TestCase): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestLogConfigurator(utils.TestCase): | class TestLogConfigurator(utils.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestLogConfigurator, self).setUp() |         super(TestLogConfigurator, self).setUp() | ||||||
|         self.options = mock.Mock() |         self.options = mock.Mock() | ||||||
|   | |||||||
| @@ -75,7 +75,7 @@ class TestTiming(utils.TestCommand): | |||||||
|     def test_timing_list(self): |     def test_timing_list(self): | ||||||
|         self.app.timing_data = [( |         self.app.timing_data = [( | ||||||
|             timing_url, |             timing_url, | ||||||
|             datetime.timedelta(microseconds=timing_elapsed*1000000), |             datetime.timedelta(microseconds=timing_elapsed * 1000000), | ||||||
|         )] |         )] | ||||||
|  |  | ||||||
|         arglist = [] |         arglist = [] | ||||||
|   | |||||||
| @@ -250,6 +250,7 @@ class NoUniqueMatch(Exception): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestFindResource(test_utils.TestCase): | class TestFindResource(test_utils.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestFindResource, self).setUp() |         super(TestFindResource, self).setUp() | ||||||
|         self.name = 'legos' |         self.name = 'legos' | ||||||
|   | |||||||
| @@ -87,6 +87,7 @@ SERVICE = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeComputev2Client(object): | class FakeComputev2Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.aggregates = mock.Mock() |         self.aggregates = mock.Mock() | ||||||
|         self.aggregates.resource_class = fakes.FakeResource(None, {}) |         self.aggregates.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -142,6 +143,7 @@ class FakeComputev2Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestComputev2(utils.TestCommand): | class TestComputev2(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestComputev2, self).setUp() |         super(TestComputev2, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -51,6 +51,7 @@ TEST_VERSIONS = fixture.DiscoveryList(href=AUTH_URL) | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeStdout(object): | class FakeStdout(object): | ||||||
|  |  | ||||||
|     def __init__(self): |     def __init__(self): | ||||||
|         self.content = [] |         self.content = [] | ||||||
|  |  | ||||||
| @@ -65,6 +66,7 @@ class FakeStdout(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeLog(object): | class FakeLog(object): | ||||||
|  |  | ||||||
|     def __init__(self): |     def __init__(self): | ||||||
|         self.messages = {} |         self.messages = {} | ||||||
|  |  | ||||||
| @@ -85,6 +87,7 @@ class FakeLog(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeApp(object): | class FakeApp(object): | ||||||
|  |  | ||||||
|     def __init__(self, _stdout, _log): |     def __init__(self, _stdout, _log): | ||||||
|         self.stdout = _stdout |         self.stdout = _stdout | ||||||
|         self.client_manager = None |         self.client_manager = None | ||||||
| @@ -95,12 +98,14 @@ class FakeApp(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeClient(object): | class FakeClient(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.endpoint = kwargs['endpoint'] |         self.endpoint = kwargs['endpoint'] | ||||||
|         self.token = kwargs['token'] |         self.token = kwargs['token'] | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeClientManager(object): | class FakeClientManager(object): | ||||||
|  |  | ||||||
|     def __init__(self): |     def __init__(self): | ||||||
|         self.compute = None |         self.compute = None | ||||||
|         self.identity = None |         self.identity = None | ||||||
| @@ -129,12 +134,14 @@ class FakeClientManager(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeModule(object): | class FakeModule(object): | ||||||
|  |  | ||||||
|     def __init__(self, name, version): |     def __init__(self, name, version): | ||||||
|         self.name = name |         self.name = name | ||||||
|         self.__version__ = version |         self.__version__ = version | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeResource(object): | class FakeResource(object): | ||||||
|  |  | ||||||
|     def __init__(self, manager=None, info={}, loaded=False, methods={}): |     def __init__(self, manager=None, info={}, loaded=False, methods={}): | ||||||
|         """Set attributes and methods for a resource. |         """Set attributes and methods for a resource. | ||||||
|  |  | ||||||
| @@ -178,6 +185,7 @@ class FakeResource(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeResponse(requests.Response): | class FakeResponse(requests.Response): | ||||||
|  |  | ||||||
|     def __init__(self, headers={}, status_code=200, data=None, encoding=None): |     def __init__(self, headers={}, status_code=200, data=None, encoding=None): | ||||||
|         super(FakeResponse, self).__init__() |         super(FakeResponse, self).__init__() | ||||||
|  |  | ||||||
| @@ -190,6 +198,7 @@ class FakeResponse(requests.Response): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeModel(dict): | class FakeModel(dict): | ||||||
|  |  | ||||||
|     def __getattr__(self, key): |     def __getattr__(self, key): | ||||||
|         try: |         try: | ||||||
|             return self[key] |             return self[key] | ||||||
|   | |||||||
| @@ -128,6 +128,7 @@ EXTENSION = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeIdentityv2Client(object): | class FakeIdentityv2Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.roles = mock.Mock() |         self.roles = mock.Mock() | ||||||
|         self.roles.resource_class = fakes.FakeResource(None, {}) |         self.roles.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -157,6 +158,7 @@ class FakeIdentityv2Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestIdentityv2(utils.TestCommand): | class TestIdentityv2(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestIdentityv2, self).setUp() |         super(TestIdentityv2, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -420,6 +420,7 @@ OAUTH_VERIFIER = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeAuth(object): | class FakeAuth(object): | ||||||
|  |  | ||||||
|     def __init__(self, auth_method_class=None): |     def __init__(self, auth_method_class=None): | ||||||
|         self._auth_method_class = auth_method_class |         self._auth_method_class = auth_method_class | ||||||
|  |  | ||||||
| @@ -428,11 +429,13 @@ class FakeAuth(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeSession(object): | class FakeSession(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.auth = FakeAuth() |         self.auth = FakeAuth() | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeIdentityv3Client(object): | class FakeIdentityv3Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.domains = mock.Mock() |         self.domains = mock.Mock() | ||||||
|         self.domains.resource_class = fakes.FakeResource(None, {}) |         self.domains.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -468,6 +471,7 @@ class FakeIdentityv3Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeFederationManager(object): | class FakeFederationManager(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.identity_providers = mock.Mock() |         self.identity_providers = mock.Mock() | ||||||
|         self.identity_providers.resource_class = fakes.FakeResource(None, {}) |         self.identity_providers.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -484,12 +488,14 @@ class FakeFederationManager(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeFederatedClient(FakeIdentityv3Client): | class FakeFederatedClient(FakeIdentityv3Client): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         super(FakeFederatedClient, self).__init__(**kwargs) |         super(FakeFederatedClient, self).__init__(**kwargs) | ||||||
|         self.federation = FakeFederationManager() |         self.federation = FakeFederationManager() | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeOAuth1Client(FakeIdentityv3Client): | class FakeOAuth1Client(FakeIdentityv3Client): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         super(FakeOAuth1Client, self).__init__(**kwargs) |         super(FakeOAuth1Client, self).__init__(**kwargs) | ||||||
|  |  | ||||||
| @@ -502,6 +508,7 @@ class FakeOAuth1Client(FakeIdentityv3Client): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestIdentityv3(utils.TestCommand): | class TestIdentityv3(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestIdentityv3, self).setUp() |         super(TestIdentityv3, self).setUp() | ||||||
|  |  | ||||||
| @@ -512,6 +519,7 @@ class TestIdentityv3(utils.TestCommand): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestFederatedIdentity(utils.TestCommand): | class TestFederatedIdentity(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestFederatedIdentity, self).setUp() |         super(TestFederatedIdentity, self).setUp() | ||||||
|  |  | ||||||
| @@ -522,6 +530,7 @@ class TestFederatedIdentity(utils.TestCommand): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestOAuth1(utils.TestCommand): | class TestOAuth1(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestOAuth1, self).setUp() |         super(TestOAuth1, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,6 +46,7 @@ class TestCredential(identity_fakes.TestIdentityv3): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestCredentialSet(TestCredential): | class TestCredentialSet(TestCredential): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestCredentialSet, self).setUp() |         super(TestCredentialSet, self).setUp() | ||||||
|         self.cmd = credential.SetCredential(self.app, None) |         self.cmd = credential.SetCredential(self.app, None) | ||||||
|   | |||||||
| @@ -368,6 +368,7 @@ class TestIdentityProviderSet(TestIdentityProvider): | |||||||
|  |  | ||||||
|     def test_identity_provider_set_description(self): |     def test_identity_provider_set_description(self): | ||||||
|         """Set Identity Provider's description. """ |         """Set Identity Provider's description. """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             updated_idp = copy.deepcopy(identity_fakes.IDENTITY_PROVIDER) |             updated_idp = copy.deepcopy(identity_fakes.IDENTITY_PROVIDER) | ||||||
| @@ -412,6 +413,7 @@ class TestIdentityProviderSet(TestIdentityProvider): | |||||||
|  |  | ||||||
|         Set Identity Provider's ``enabled`` attribute to False. |         Set Identity Provider's ``enabled`` attribute to False. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             updated_idp = copy.deepcopy(identity_fakes.IDENTITY_PROVIDER) |             updated_idp = copy.deepcopy(identity_fakes.IDENTITY_PROVIDER) | ||||||
| @@ -459,6 +461,7 @@ class TestIdentityProviderSet(TestIdentityProvider): | |||||||
|  |  | ||||||
|         Set Identity Provider's ``enabled`` attribute to True. |         Set Identity Provider's ``enabled`` attribute to True. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             resources = fakes.FakeResource( |             resources = fakes.FakeResource( | ||||||
| @@ -495,6 +498,7 @@ class TestIdentityProviderSet(TestIdentityProvider): | |||||||
|  |  | ||||||
|         Set Identity Provider's ``enabled`` attribute to True. |         Set Identity Provider's ``enabled`` attribute to True. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             self.new_remote_id = 'new_entity' |             self.new_remote_id = 'new_entity' | ||||||
| @@ -540,6 +544,7 @@ class TestIdentityProviderSet(TestIdentityProvider): | |||||||
|  |  | ||||||
|         Set Identity Provider's ``enabled`` attribute to True. |         Set Identity Provider's ``enabled`` attribute to True. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             self.new_remote_id = 'new_entity' |             self.new_remote_id = 'new_entity' | ||||||
|   | |||||||
| @@ -33,71 +33,74 @@ class TestMapping(identity_fakes.TestFederatedIdentity): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestMappingCreate(TestMapping): | class TestMappingCreate(TestMapping): | ||||||
|         def setUp(self): |  | ||||||
|                 super(TestMappingCreate, self).setUp() |  | ||||||
|                 self.mapping_mock.create.return_value = fakes.FakeResource( |  | ||||||
|                     None, |  | ||||||
|                     copy.deepcopy(identity_fakes.MAPPING_RESPONSE), |  | ||||||
|                     loaded=True |  | ||||||
|                 ) |  | ||||||
|                 self.cmd = mapping.CreateMapping(self.app, None) |  | ||||||
|  |  | ||||||
|         def test_create_mapping(self): |     def setUp(self): | ||||||
|                 arglist = [ |         super(TestMappingCreate, self).setUp() | ||||||
|                     '--rules', identity_fakes.mapping_rules_file_path, |         self.mapping_mock.create.return_value = fakes.FakeResource( | ||||||
|                     identity_fakes.mapping_id |             None, | ||||||
|                 ] |             copy.deepcopy(identity_fakes.MAPPING_RESPONSE), | ||||||
|                 verifylist = [ |             loaded=True | ||||||
|                     ('mapping', identity_fakes.mapping_id), |         ) | ||||||
|                     ('rules', identity_fakes.mapping_rules_file_path) |         self.cmd = mapping.CreateMapping(self.app, None) | ||||||
|                 ] |  | ||||||
|  |  | ||||||
|                 parsed_args = self.check_parser(self.cmd, arglist, verifylist) |     def test_create_mapping(self): | ||||||
|  |         arglist = [ | ||||||
|  |             '--rules', identity_fakes.mapping_rules_file_path, | ||||||
|  |             identity_fakes.mapping_id | ||||||
|  |         ] | ||||||
|  |         verifylist = [ | ||||||
|  |             ('mapping', identity_fakes.mapping_id), | ||||||
|  |             ('rules', identity_fakes.mapping_rules_file_path) | ||||||
|  |         ] | ||||||
|  |  | ||||||
|                 mocker = mock.Mock() |         parsed_args = self.check_parser(self.cmd, arglist, verifylist) | ||||||
|                 mocker.return_value = identity_fakes.MAPPING_RULES |  | ||||||
|                 with mock.patch("openstackclient.identity.v3.mapping." |  | ||||||
|                                 "CreateMapping._read_rules", mocker): |  | ||||||
|                         columns, data = self.cmd.take_action(parsed_args) |  | ||||||
|  |  | ||||||
|                 self.mapping_mock.create.assert_called_with( |         mocker = mock.Mock() | ||||||
|                     mapping_id=identity_fakes.mapping_id, |         mocker.return_value = identity_fakes.MAPPING_RULES | ||||||
|                     rules=identity_fakes.MAPPING_RULES) |         with mock.patch("openstackclient.identity.v3.mapping." | ||||||
|  |                         "CreateMapping._read_rules", mocker): | ||||||
|  |             columns, data = self.cmd.take_action(parsed_args) | ||||||
|  |  | ||||||
|                 collist = ('id', 'rules') |         self.mapping_mock.create.assert_called_with( | ||||||
|                 self.assertEqual(collist, columns) |             mapping_id=identity_fakes.mapping_id, | ||||||
|  |             rules=identity_fakes.MAPPING_RULES) | ||||||
|  |  | ||||||
|                 datalist = (identity_fakes.mapping_id, |         collist = ('id', 'rules') | ||||||
|                             identity_fakes.MAPPING_RULES) |         self.assertEqual(collist, columns) | ||||||
|                 self.assertEqual(datalist, data) |  | ||||||
|  |         datalist = (identity_fakes.mapping_id, | ||||||
|  |                     identity_fakes.MAPPING_RULES) | ||||||
|  |         self.assertEqual(datalist, data) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestMappingDelete(TestMapping): | class TestMappingDelete(TestMapping): | ||||||
|         def setUp(self): |  | ||||||
|             super(TestMappingDelete, self).setUp() |  | ||||||
|             self.mapping_mock.get.return_value = fakes.FakeResource( |  | ||||||
|                 None, |  | ||||||
|                 copy.deepcopy(identity_fakes.MAPPING_RESPONSE), |  | ||||||
|                 loaded=True) |  | ||||||
|  |  | ||||||
|             self.mapping_mock.delete.return_value = None |     def setUp(self): | ||||||
|             self.cmd = mapping.DeleteMapping(self.app, None) |         super(TestMappingDelete, self).setUp() | ||||||
|  |         self.mapping_mock.get.return_value = fakes.FakeResource( | ||||||
|  |             None, | ||||||
|  |             copy.deepcopy(identity_fakes.MAPPING_RESPONSE), | ||||||
|  |             loaded=True) | ||||||
|  |  | ||||||
|         def test_delete_mapping(self): |         self.mapping_mock.delete.return_value = None | ||||||
|             arglist = [ |         self.cmd = mapping.DeleteMapping(self.app, None) | ||||||
|                 identity_fakes.mapping_id |  | ||||||
|             ] |  | ||||||
|             verifylist = [ |  | ||||||
|                 ('mapping', identity_fakes.mapping_id) |  | ||||||
|             ] |  | ||||||
|  |  | ||||||
|             parsed_args = self.check_parser(self.cmd, arglist, verifylist) |     def test_delete_mapping(self): | ||||||
|             self.cmd.take_action(parsed_args) |         arglist = [ | ||||||
|             self.mapping_mock.delete.assert_called_with( |             identity_fakes.mapping_id | ||||||
|                 identity_fakes.mapping_id) |         ] | ||||||
|  |         verifylist = [ | ||||||
|  |             ('mapping', identity_fakes.mapping_id) | ||||||
|  |         ] | ||||||
|  |  | ||||||
|  |         parsed_args = self.check_parser(self.cmd, arglist, verifylist) | ||||||
|  |         self.cmd.take_action(parsed_args) | ||||||
|  |         self.mapping_mock.delete.assert_called_with( | ||||||
|  |             identity_fakes.mapping_id) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestMappingList(TestMapping): | class TestMappingList(TestMapping): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestMappingList, self).setUp() |         super(TestMappingList, self).setUp() | ||||||
|         self.mapping_mock.get.return_value = fakes.FakeResource( |         self.mapping_mock.get.return_value = fakes.FakeResource( | ||||||
| @@ -141,6 +144,7 @@ class TestMappingList(TestMapping): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestMappingShow(TestMapping): | class TestMappingShow(TestMapping): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestMappingShow, self).setUp() |         super(TestMappingShow, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -557,7 +557,7 @@ class TestRoleAssignmentList(TestRoleAssignment): | |||||||
|             '@'.join([identity_fakes.user_name, identity_fakes.domain_name]), |             '@'.join([identity_fakes.user_name, identity_fakes.domain_name]), | ||||||
|             '', |             '', | ||||||
|             '@'.join([identity_fakes.project_name, |             '@'.join([identity_fakes.project_name, | ||||||
|                      identity_fakes.domain_name]), |                       identity_fakes.domain_name]), | ||||||
|             '', |             '', | ||||||
|             False |             False | ||||||
|         ), (identity_fakes.role_name, |         ), (identity_fakes.role_name, | ||||||
|   | |||||||
| @@ -305,6 +305,7 @@ class TestServiceProviderSet(TestServiceProvider): | |||||||
|  |  | ||||||
|         Set Service Provider's ``enabled`` attribute to False. |         Set Service Provider's ``enabled`` attribute to False. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             updated_sp = copy.deepcopy(service_fakes.SERVICE_PROVIDER) |             updated_sp = copy.deepcopy(service_fakes.SERVICE_PROVIDER) | ||||||
| @@ -343,6 +344,7 @@ class TestServiceProviderSet(TestServiceProvider): | |||||||
|  |  | ||||||
|         Set Service Provider's ``enabled`` attribute to True. |         Set Service Provider's ``enabled`` attribute to True. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|         def prepare(self): |         def prepare(self): | ||||||
|             """Prepare fake return objects before the test is executed""" |             """Prepare fake return objects before the test is executed""" | ||||||
|             resources = fakes.FakeResource( |             resources = fakes.FakeResource( | ||||||
|   | |||||||
| @@ -53,6 +53,7 @@ IMAGE_data = tuple((IMAGE_output[x] for x in sorted(IMAGE_output))) | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeImagev1Client(object): | class FakeImagev1Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.images = mock.Mock() |         self.images = mock.Mock() | ||||||
|         self.images.resource_class = fakes.FakeResource(None, {}) |         self.images.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -61,6 +62,7 @@ class FakeImagev1Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestImagev1(utils.TestCommand): | class TestImagev1(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestImagev1, self).setUp() |         super(TestImagev1, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -148,6 +148,7 @@ IMAGE_schema = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeImagev2Client(object): | class FakeImagev2Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.images = mock.Mock() |         self.images = mock.Mock() | ||||||
|         self.images.resource_class = fakes.FakeResource(None, {}) |         self.images.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -158,6 +159,7 @@ class FakeImagev2Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestImagev2(utils.TestCommand): | class TestImagev2(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestImagev2, self).setUp() |         super(TestImagev2, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -381,7 +381,7 @@ class TestAddProjectToImage(TestImage): | |||||||
|         arglist = [ |         arglist = [ | ||||||
|             image_fakes.image_id, |             image_fakes.image_id, | ||||||
|             identity_fakes.project_id, |             identity_fakes.project_id, | ||||||
|             ] |         ] | ||||||
|         verifylist = [ |         verifylist = [ | ||||||
|             ('image', image_fakes.image_id), |             ('image', image_fakes.image_id), | ||||||
|             ('project', identity_fakes.project_id), |             ('project', identity_fakes.project_id), | ||||||
|   | |||||||
| @@ -46,6 +46,7 @@ def _add_compute_argument(parser): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeNetworkAndComputeCommand(common.NetworkAndComputeCommand): | class FakeNetworkAndComputeCommand(common.NetworkAndComputeCommand): | ||||||
|  |  | ||||||
|     def update_parser_common(self, parser): |     def update_parser_common(self, parser): | ||||||
|         return _add_common_argument(parser) |         return _add_common_argument(parser) | ||||||
|  |  | ||||||
| @@ -63,6 +64,7 @@ class FakeNetworkAndComputeCommand(common.NetworkAndComputeCommand): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeNetworkAndComputeLister(common.NetworkAndComputeLister): | class FakeNetworkAndComputeLister(common.NetworkAndComputeLister): | ||||||
|  |  | ||||||
|     def update_parser_common(self, parser): |     def update_parser_common(self, parser): | ||||||
|         return _add_common_argument(parser) |         return _add_common_argument(parser) | ||||||
|  |  | ||||||
| @@ -80,6 +82,7 @@ class FakeNetworkAndComputeLister(common.NetworkAndComputeLister): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeNetworkAndComputeShowOne(common.NetworkAndComputeShowOne): | class FakeNetworkAndComputeShowOne(common.NetworkAndComputeShowOne): | ||||||
|  |  | ||||||
|     def update_parser_common(self, parser): |     def update_parser_common(self, parser): | ||||||
|         return _add_common_argument(parser) |         return _add_common_argument(parser) | ||||||
|  |  | ||||||
| @@ -97,6 +100,7 @@ class FakeNetworkAndComputeShowOne(common.NetworkAndComputeShowOne): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestNetworkAndCompute(utils.TestCommand): | class TestNetworkAndCompute(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestNetworkAndCompute, self).setUp() |         super(TestNetworkAndCompute, self).setUp() | ||||||
|  |  | ||||||
| @@ -150,18 +154,21 @@ class TestNetworkAndCompute(utils.TestCommand): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestNetworkAndComputeCommand(TestNetworkAndCompute): | class TestNetworkAndComputeCommand(TestNetworkAndCompute): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestNetworkAndComputeCommand, self).setUp() |         super(TestNetworkAndComputeCommand, self).setUp() | ||||||
|         self.cmd = FakeNetworkAndComputeCommand(self.app, self.namespace) |         self.cmd = FakeNetworkAndComputeCommand(self.app, self.namespace) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestNetworkAndComputeLister(TestNetworkAndCompute): | class TestNetworkAndComputeLister(TestNetworkAndCompute): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestNetworkAndComputeLister, self).setUp() |         super(TestNetworkAndComputeLister, self).setUp() | ||||||
|         self.cmd = FakeNetworkAndComputeLister(self.app, self.namespace) |         self.cmd = FakeNetworkAndComputeLister(self.app, self.namespace) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestNetworkAndComputeShowOne(TestNetworkAndCompute): | class TestNetworkAndComputeShowOne(TestNetworkAndCompute): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestNetworkAndComputeShowOne, self).setUp() |         super(TestNetworkAndComputeShowOne, self).setUp() | ||||||
|         self.cmd = FakeNetworkAndComputeShowOne(self.app, self.namespace) |         self.cmd = FakeNetworkAndComputeShowOne(self.app, self.namespace) | ||||||
|   | |||||||
| @@ -51,11 +51,13 @@ def create_extension(): | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeNetworkV2Client(object): | class FakeNetworkV2Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.extensions = mock.Mock(return_value=[create_extension()]) |         self.extensions = mock.Mock(return_value=[create_extension()]) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestNetworkV2(utils.TestCommand): | class TestNetworkV2(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestNetworkV2, self).setUp() |         super(TestNetworkV2, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ from openstackclient.tests import utils as tests_utils | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSubnet(network_fakes.TestNetworkV2): | class TestSubnet(network_fakes.TestNetworkV2): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSubnet, self).setUp() |         super(TestSubnet, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ from openstackclient.tests import utils as tests_utils | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSubnetPool(network_fakes.TestNetworkV2): | class TestSubnetPool(network_fakes.TestNetworkV2): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSubnetPool, self).setUp() |         super(TestSubnetPool, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -76,6 +76,7 @@ OBJECT_2 = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestObjectv1(utils.TestCommand): | class TestObjectv1(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestObjectv1, self).setUp() |         super(TestObjectv1, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,6 +26,7 @@ AUTH_URL = "http://0.0.0.0" | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeClient(object): | class FakeClient(object): | ||||||
|  |  | ||||||
|     def __init__(self, endpoint=None, **kwargs): |     def __init__(self, endpoint=None, **kwargs): | ||||||
|         self.endpoint = AUTH_URL |         self.endpoint = AUTH_URL | ||||||
|         self.token = AUTH_TOKEN |         self.token = AUTH_TOKEN | ||||||
|   | |||||||
| @@ -26,6 +26,7 @@ AUTH_URL = "http://0.0.0.0" | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestObject(object_fakes.TestObjectv1): | class TestObject(object_fakes.TestObjectv1): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestObject, self).setUp() |         super(TestObject, self).setUp() | ||||||
|         self.app.client_manager.object_store = object_store.APIv1( |         self.app.client_manager.object_store = object_store.APIv1( | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ from openstackclient.tests.object.v1 import fakes as object_fakes | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestObjectAll(object_fakes.TestObjectv1): | class TestObjectAll(object_fakes.TestObjectv1): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestObjectAll, self).setUp() |         super(TestObjectAll, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -161,6 +161,7 @@ def fake_execute(shell, cmd): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShell(utils.TestCase): | class TestShell(utils.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShell, self).setUp() |         super(TestShell, self).setUp() | ||||||
|         patch = "openstackclient.shell.OpenStackShell.run_subcommand" |         patch = "openstackclient.shell.OpenStackShell.run_subcommand" | ||||||
| @@ -280,6 +281,7 @@ class TestShell(utils.TestCase): | |||||||
|  |  | ||||||
| class TestShellHelp(TestShell): | class TestShellHelp(TestShell): | ||||||
|     """Test the deferred help flag""" |     """Test the deferred help flag""" | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellHelp, self).setUp() |         super(TestShellHelp, self).setUp() | ||||||
|         self.orig_env, os.environ = os.environ, {} |         self.orig_env, os.environ = os.environ, {} | ||||||
| @@ -304,6 +306,7 @@ class TestShellHelp(TestShell): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShellOptions(TestShell): | class TestShellOptions(TestShell): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellOptions, self).setUp() |         super(TestShellOptions, self).setUp() | ||||||
|         self.orig_env, os.environ = os.environ, {} |         self.orig_env, os.environ = os.environ, {} | ||||||
| @@ -391,6 +394,7 @@ class TestShellOptions(TestShell): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShellTokenAuthEnv(TestShell): | class TestShellTokenAuthEnv(TestShell): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellTokenAuthEnv, self).setUp() |         super(TestShellTokenAuthEnv, self).setUp() | ||||||
|         env = { |         env = { | ||||||
| @@ -438,6 +442,7 @@ class TestShellTokenAuthEnv(TestShell): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShellTokenEndpointAuthEnv(TestShell): | class TestShellTokenEndpointAuthEnv(TestShell): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellTokenEndpointAuthEnv, self).setUp() |         super(TestShellTokenEndpointAuthEnv, self).setUp() | ||||||
|         env = { |         env = { | ||||||
| @@ -485,6 +490,7 @@ class TestShellTokenEndpointAuthEnv(TestShell): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShellCli(TestShell): | class TestShellCli(TestShell): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellCli, self).setUp() |         super(TestShellCli, self).setUp() | ||||||
|         env = { |         env = { | ||||||
| @@ -706,6 +712,7 @@ class TestShellCli(TestShell): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestShellCliEnv(TestShell): | class TestShellCliEnv(TestShell): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestShellCliEnv, self).setUp() |         super(TestShellCliEnv, self).setUp() | ||||||
|         env = { |         env = { | ||||||
|   | |||||||
| @@ -28,6 +28,7 @@ class ParserException(Exception): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestCase(testtools.TestCase): | class TestCase(testtools.TestCase): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         testtools.TestCase.setUp(self) |         testtools.TestCase.setUp(self) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -130,11 +130,13 @@ QOS_WITH_ASSOCIATIONS = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeImagev1Client(object): | class FakeImagev1Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.images = mock.Mock() |         self.images = mock.Mock() | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeVolumev1Client(object): | class FakeVolumev1Client(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.volumes = mock.Mock() |         self.volumes = mock.Mock() | ||||||
|         self.volumes.resource_class = fakes.FakeResource(None, {}) |         self.volumes.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -151,6 +153,7 @@ class FakeVolumev1Client(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestVolumev1(utils.TestCommand): | class TestVolumev1(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestVolumev1, self).setUp() |         super(TestVolumev1, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ class TestQos(volume_fakes.TestVolumev1): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosAssociate(TestQos): | class TestQosAssociate(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosAssociate, self).setUp() |         super(TestQosAssociate, self).setUp() | ||||||
|  |  | ||||||
| @@ -183,6 +184,7 @@ class TestQosCreate(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosDelete(TestQos): | class TestQosDelete(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosDelete, self).setUp() |         super(TestQosDelete, self).setUp() | ||||||
|  |  | ||||||
| @@ -223,6 +225,7 @@ class TestQosDelete(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosDisassociate(TestQos): | class TestQosDisassociate(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosDisassociate, self).setUp() |         super(TestQosDisassociate, self).setUp() | ||||||
|  |  | ||||||
| @@ -277,6 +280,7 @@ class TestQosDisassociate(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosList(TestQos): | class TestQosList(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosList, self).setUp() |         super(TestQosList, self).setUp() | ||||||
|  |  | ||||||
| @@ -323,6 +327,7 @@ class TestQosList(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosSet(TestQos): | class TestQosSet(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosSet, self).setUp() |         super(TestQosSet, self).setUp() | ||||||
|  |  | ||||||
| @@ -354,6 +359,7 @@ class TestQosSet(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosShow(TestQos): | class TestQosShow(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosShow, self).setUp() |         super(TestQosShow, self).setUp() | ||||||
|  |  | ||||||
| @@ -405,6 +411,7 @@ class TestQosShow(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosUnset(TestQos): | class TestQosUnset(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosUnset, self).setUp() |         super(TestQosUnset, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -213,6 +213,7 @@ IMAGE = { | |||||||
|  |  | ||||||
|  |  | ||||||
| class FakeVolumeClient(object): | class FakeVolumeClient(object): | ||||||
|  |  | ||||||
|     def __init__(self, **kwargs): |     def __init__(self, **kwargs): | ||||||
|         self.volumes = mock.Mock() |         self.volumes = mock.Mock() | ||||||
|         self.volumes.resource_class = fakes.FakeResource(None, {}) |         self.volumes.resource_class = fakes.FakeResource(None, {}) | ||||||
| @@ -233,6 +234,7 @@ class FakeVolumeClient(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestVolume(utils.TestCommand): | class TestVolume(utils.TestCommand): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestVolume, self).setUp() |         super(TestVolume, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -33,6 +33,7 @@ class TestBackup(volume_fakes.TestVolume): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestBackupCreate(TestBackup): | class TestBackupCreate(TestBackup): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestBackupCreate, self).setUp() |         super(TestBackupCreate, self).setUp() | ||||||
|  |  | ||||||
| @@ -78,6 +79,7 @@ class TestBackupCreate(TestBackup): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestBackupShow(TestBackup): | class TestBackupShow(TestBackup): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestBackupShow, self).setUp() |         super(TestBackupShow, self).setUp() | ||||||
|  |  | ||||||
| @@ -105,6 +107,7 @@ class TestBackupShow(TestBackup): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestBackupDelete(TestBackup): | class TestBackupDelete(TestBackup): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestBackupDelete, self).setUp() |         super(TestBackupDelete, self).setUp() | ||||||
|  |  | ||||||
| @@ -132,6 +135,7 @@ class TestBackupDelete(TestBackup): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestBackupRestore(TestBackup): | class TestBackupRestore(TestBackup): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestBackupRestore, self).setUp() |         super(TestBackupRestore, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ class TestQos(volume_fakes.TestVolume): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosAssociate(TestQos): | class TestQosAssociate(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosAssociate, self).setUp() |         super(TestQosAssociate, self).setUp() | ||||||
|  |  | ||||||
| @@ -184,6 +185,7 @@ class TestQosCreate(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosDelete(TestQos): | class TestQosDelete(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosDelete, self).setUp() |         super(TestQosDelete, self).setUp() | ||||||
|  |  | ||||||
| @@ -224,6 +226,7 @@ class TestQosDelete(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosDisassociate(TestQos): | class TestQosDisassociate(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosDisassociate, self).setUp() |         super(TestQosDisassociate, self).setUp() | ||||||
|  |  | ||||||
| @@ -278,6 +281,7 @@ class TestQosDisassociate(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosList(TestQos): | class TestQosList(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosList, self).setUp() |         super(TestQosList, self).setUp() | ||||||
|  |  | ||||||
| @@ -324,6 +328,7 @@ class TestQosList(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosSet(TestQos): | class TestQosSet(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosSet, self).setUp() |         super(TestQosSet, self).setUp() | ||||||
|  |  | ||||||
| @@ -355,6 +360,7 @@ class TestQosSet(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosShow(TestQos): | class TestQosShow(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosShow, self).setUp() |         super(TestQosShow, self).setUp() | ||||||
|  |  | ||||||
| @@ -406,6 +412,7 @@ class TestQosShow(TestQos): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestQosUnset(TestQos): | class TestQosUnset(TestQos): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestQosUnset, self).setUp() |         super(TestQosUnset, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -31,6 +31,7 @@ class TestSnapshot(volume_fakes.TestVolume): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSnapshotCreate(TestSnapshot): | class TestSnapshotCreate(TestSnapshot): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSnapshotCreate, self).setUp() |         super(TestSnapshotCreate, self).setUp() | ||||||
|  |  | ||||||
| @@ -76,6 +77,7 @@ class TestSnapshotCreate(TestSnapshot): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSnapshotShow(TestSnapshot): | class TestSnapshotShow(TestSnapshot): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSnapshotShow, self).setUp() |         super(TestSnapshotShow, self).setUp() | ||||||
|  |  | ||||||
| @@ -103,6 +105,7 @@ class TestSnapshotShow(TestSnapshot): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSnapshotDelete(TestSnapshot): | class TestSnapshotDelete(TestSnapshot): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSnapshotDelete, self).setUp() |         super(TestSnapshotDelete, self).setUp() | ||||||
|  |  | ||||||
| @@ -130,6 +133,7 @@ class TestSnapshotDelete(TestSnapshot): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSnapshotSet(TestSnapshot): | class TestSnapshotSet(TestSnapshot): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSnapshotSet, self).setUp() |         super(TestSnapshotSet, self).setUp() | ||||||
|  |  | ||||||
| @@ -171,6 +175,7 @@ class TestSnapshotSet(TestSnapshot): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestSnapshotUnset(TestSnapshot): | class TestSnapshotUnset(TestSnapshot): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestSnapshotUnset, self).setUp() |         super(TestSnapshotUnset, self).setUp() | ||||||
|  |  | ||||||
| @@ -247,7 +252,7 @@ class TestSnapshotList(TestSnapshot): | |||||||
|             volume_fakes.snapshot_description, |             volume_fakes.snapshot_description, | ||||||
|             "available", |             "available", | ||||||
|             volume_fakes.snapshot_size |             volume_fakes.snapshot_size | ||||||
|             ),) |         ),) | ||||||
|         self.assertEqual(datalist, tuple(data)) |         self.assertEqual(datalist, tuple(data)) | ||||||
|  |  | ||||||
|     def test_snapshot_list_with_options(self): |     def test_snapshot_list_with_options(self): | ||||||
|   | |||||||
| @@ -147,7 +147,7 @@ class TestTypeList(TestType): | |||||||
|         datalist = (( |         datalist = (( | ||||||
|             volume_fakes.type_id, |             volume_fakes.type_id, | ||||||
|             volume_fakes.type_name, |             volume_fakes.type_name, | ||||||
|             ),) |         ),) | ||||||
|         self.assertEqual(datalist, tuple(data)) |         self.assertEqual(datalist, tuple(data)) | ||||||
|  |  | ||||||
|     def test_type_list_with_options(self): |     def test_type_list_with_options(self): | ||||||
| @@ -166,11 +166,12 @@ class TestTypeList(TestType): | |||||||
|             volume_fakes.type_name, |             volume_fakes.type_name, | ||||||
|             volume_fakes.type_description, |             volume_fakes.type_description, | ||||||
|             "foo='bar'" |             "foo='bar'" | ||||||
|             ),) |         ),) | ||||||
|         self.assertEqual(datalist, tuple(data)) |         self.assertEqual(datalist, tuple(data)) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestTypeShow(TestType): | class TestTypeShow(TestType): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestTypeShow, self).setUp() |         super(TestTypeShow, self).setUp() | ||||||
|  |  | ||||||
| @@ -314,6 +315,7 @@ class TestTypeUnset(TestType): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestTypeDelete(TestType): | class TestTypeDelete(TestType): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestTypeDelete, self).setUp() |         super(TestTypeDelete, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -24,6 +24,7 @@ from openstackclient.volume.v2 import volume | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestVolume(volume_fakes.TestVolume): | class TestVolume(volume_fakes.TestVolume): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestVolume, self).setUp() |         super(TestVolume, self).setUp() | ||||||
|  |  | ||||||
| @@ -377,6 +378,7 @@ class TestVolumeCreate(TestVolume): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestVolumeDelete(TestVolume): | class TestVolumeDelete(TestVolume): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestVolumeDelete, self).setUp() |         super(TestVolumeDelete, self).setUp() | ||||||
|  |  | ||||||
| @@ -726,6 +728,7 @@ class TestVolumeList(TestVolume): | |||||||
|  |  | ||||||
|  |  | ||||||
| class TestVolumeShow(TestVolume): | class TestVolumeShow(TestVolume): | ||||||
|  |  | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(TestVolumeShow, self).setUp() |         super(TestVolumeShow, self).setUp() | ||||||
|  |  | ||||||
|   | |||||||
| @@ -267,7 +267,7 @@ class ListVolume(command.Lister): | |||||||
|                 'Status', |                 'Status', | ||||||
|                 'Size', |                 'Size', | ||||||
|                 'Attachments', |                 'Attachments', | ||||||
|                 ] |             ] | ||||||
|             column_headers = copy.deepcopy(columns) |             column_headers = copy.deepcopy(columns) | ||||||
|             column_headers[1] = 'Display Name' |             column_headers[1] = 'Display Name' | ||||||
|             column_headers[4] = 'Attached to' |             column_headers[4] = 'Attached to' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Brandon Palm
					Brandon Palm