From 2c950c49432f8a2d0a607eebaad4401a414b3349 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Aug 2014 20:54:19 +0200 Subject: [PATCH] Fix bad indentation in manila Closes-Bug: #1356524 Change-Id: I23557b768c53de0fb56c8dbbfe63f6baa5831ec5 Signed-off-by: Danny Al-Gaaf --- manila/share/configuration.py | 4 +-- manila/share/drivers/generic.py | 2 +- manila/share/drivers/netapp/cluster_mode.py | 2 +- manila/share/drivers/netapp/driver.py | 2 +- manila/tests/api/contrib/test_services.py | 28 +++++++++---------- .../tests/api/contrib/test_share_actions.py | 26 ++++++++--------- manila/tests/fake_network.py | 12 ++++---- manila/tests/test_migrations.py | 4 +-- manila/tests/test_share_glusterfs.py | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/manila/share/configuration.py b/manila/share/configuration.py index e04440aa90..2422a357f6 100644 --- a/manila/share/configuration.py +++ b/manila/share/configuration.py @@ -68,8 +68,8 @@ class Configuration(object): self.local_conf = CONF def _ensure_config_values(self, share_opts): - CONF.register_opts(share_opts, - group=self.config_group) + CONF.register_opts(share_opts, + group=self.config_group) def append_config_values(self, share_opts): self._ensure_config_values(share_opts) diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index 38f8f7ea3e..9cdc694405 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -501,7 +501,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver): network_info['neutron_subnet_id'], ) for helper in self._helpers.values(): - helper.init_helper(server) + helper.init_helper(server) return server def teardown_server(self, server_details, security_services=None): diff --git a/manila/share/drivers/netapp/cluster_mode.py b/manila/share/drivers/netapp/cluster_mode.py index da3012e5b7..e3921a9524 100644 --- a/manila/share/drivers/netapp/cluster_mode.py +++ b/manila/share/drivers/netapp/cluster_mode.py @@ -646,7 +646,7 @@ class NetAppClusteredShareDriver(driver.NetAppShareDriver): .get_children(): if snap.get_child_by_name('name').get_content() == snapshot_name\ and snap.get_child_by_name('busy').get_content() == 'true': - return True + return True def _share_unmount(self, share, vserver_client): """Unmounts share (required before deleting).""" diff --git a/manila/share/drivers/netapp/driver.py b/manila/share/drivers/netapp/driver.py index 4900b6d1f5..368c4d14ed 100644 --- a/manila/share/drivers/netapp/driver.py +++ b/manila/share/drivers/netapp/driver.py @@ -335,7 +335,7 @@ class NetAppShareDriver(driver.ShareDriver): for snap in snapshots.get_children(): if snap.get_child_content('name') == snapshot_name \ and snap.get_child_content('busy') == 'true': - return True + return True def _get_valid_share_name(self, share_id): """Get share name according to share name template.""" diff --git a/manila/tests/api/contrib/test_services.py b/manila/tests/api/contrib/test_services.py index fee4195da8..63321139aa 100644 --- a/manila/tests/api/contrib/test_services.py +++ b/manila/tests/api/contrib/test_services.py @@ -101,38 +101,38 @@ fake_response_service_list = {'services': [ class FakeRequest(object): - environ = {"manila.context": context.get_admin_context()} - GET = {} + environ = {"manila.context": context.get_admin_context()} + GET = {} class FakeRequestWithBinary(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"binary": "manila-share"} + environ = {"manila.context": context.get_admin_context()} + GET = {"binary": "manila-share"} class FakeRequestWithHost(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"host": "host1"} + environ = {"manila.context": context.get_admin_context()} + GET = {"host": "host1"} class FakeRequestWithZone(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"zone": "manila1"} + environ = {"manila.context": context.get_admin_context()} + GET = {"zone": "manila1"} class FakeRequestWithStatus(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"status": "enabled"} + environ = {"manila.context": context.get_admin_context()} + GET = {"status": "enabled"} class FakeRequestWithState(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"state": "up"} + environ = {"manila.context": context.get_admin_context()} + GET = {"state": "up"} class FakeRequestWithHostBinary(object): - environ = {"manila.context": context.get_admin_context()} - GET = {"host": "host1", "binary": "manila-share"} + environ = {"manila.context": context.get_admin_context()} + GET = {"host": "host1", "binary": "manila-share"} def fake_service_get_all(context): diff --git a/manila/tests/api/contrib/test_share_actions.py b/manila/tests/api/contrib/test_share_actions.py index cac99560f6..cd9f0a8d3b 100644 --- a/manila/tests/api/contrib/test_share_actions.py +++ b/manila/tests/api/contrib/test_share_actions.py @@ -32,21 +32,21 @@ CONF = cfg.CONF def _fake_access_get(self, ctxt, access_id): - class Access(object): - def __init__(self, **kwargs): - self.STATE_NEW = 'fake_new' - self.STATE_ACTIVE = 'fake_active' - self.STATE_ERROR = 'fake_error' - self.params = kwargs - self.params['state'] = self.STATE_NEW - self.share_id = kwargs.get('share_id') - self.id = access_id + class Access(object): + def __init__(self, **kwargs): + self.STATE_NEW = 'fake_new' + self.STATE_ACTIVE = 'fake_active' + self.STATE_ERROR = 'fake_error' + self.params = kwargs + self.params['state'] = self.STATE_NEW + self.share_id = kwargs.get('share_id') + self.id = access_id - def __getitem__(self, item): - return self.params[item] + def __getitem__(self, item): + return self.params[item] - access = Access(access_id=access_id, share_id='fake_share_id') - return access + access = Access(access_id=access_id, share_id='fake_share_id') + return access class ShareActionsTest(test.TestCase): diff --git a/manila/tests/fake_network.py b/manila/tests/fake_network.py index 7e143f3591..dedc16d33f 100644 --- a/manila/tests/fake_network.py +++ b/manila/tests/fake_network.py @@ -126,14 +126,14 @@ class API(object): port['admin_state_up'] = True port['tenant_id'] = tenant_id if fixed_ip: - fixed_ip_dict = {'ip_address': fixed_ip} - if subnet_id: - fixed_ip_dict.update({'subnet_id': subnet_id}) - port['fixed_ips'] = [fixed_ip_dict] + fixed_ip_dict = {'ip_address': fixed_ip} + if subnet_id: + fixed_ip_dict.update({'subnet_id': subnet_id}) + port['fixed_ips'] = [fixed_ip_dict] if device_owner: - port['device_owner'] = device_owner + port['device_owner'] = device_owner if device_id: - port['device_id'] = device_id + port['device_id'] = device_id return port def list_ports(self, **search_opts): diff --git a/manila/tests/test_migrations.py b/manila/tests/test_migrations.py index 315ecad6fe..2a45b8041b 100644 --- a/manila/tests/test_migrations.py +++ b/manila/tests/test_migrations.py @@ -118,8 +118,8 @@ class TestMigrations(test.TestCase, cp.read(self.CONFIG_FILE_PATH) self.snake_walk = cp.getboolean('walk_style', 'snake_walk') except ConfigParser.ParsingError as e: - self.fail("Failed to read test_migrations.conf config " - "file. Got error: %s" % e) + self.fail("Failed to read test_migrations.conf config " + "file. Got error: %s" % e) def _cleanup(self): shutil.rmtree(os.environ["OSLO_LOCK_PATH"], ignore_errors=True) diff --git a/manila/tests/test_share_glusterfs.py b/manila/tests/test_share_glusterfs.py index ce40a5f54d..0694e669be 100644 --- a/manila/tests/test_share_glusterfs.py +++ b/manila/tests/test_share_glusterfs.py @@ -162,7 +162,7 @@ class GlusterfsShareDriverTestCase(test.TestCase): glusterfs.LOG.error = Mock() def exec_runner(*ignore_args, **ignore_kwargs): - raise exception.ProcessExecutionError(stderr='testvol') + raise exception.ProcessExecutionError(stderr='testvol') expected_exec = ['gluster volume set testvol nfs.export-volumes off'] fake_utils.fake_execute_set_repliers([(expected_exec[0], exec_runner)])