Merge "Fix bad indentation in manila"
This commit is contained in:
commit
90fd87fdc9
@ -68,8 +68,8 @@ class Configuration(object):
|
|||||||
self.local_conf = CONF
|
self.local_conf = CONF
|
||||||
|
|
||||||
def _ensure_config_values(self, share_opts):
|
def _ensure_config_values(self, share_opts):
|
||||||
CONF.register_opts(share_opts,
|
CONF.register_opts(share_opts,
|
||||||
group=self.config_group)
|
group=self.config_group)
|
||||||
|
|
||||||
def append_config_values(self, share_opts):
|
def append_config_values(self, share_opts):
|
||||||
self._ensure_config_values(share_opts)
|
self._ensure_config_values(share_opts)
|
||||||
|
@ -500,7 +500,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
|
|||||||
network_info['neutron_subnet_id'],
|
network_info['neutron_subnet_id'],
|
||||||
)
|
)
|
||||||
for helper in self._helpers.values():
|
for helper in self._helpers.values():
|
||||||
helper.init_helper(server)
|
helper.init_helper(server)
|
||||||
return server
|
return server
|
||||||
|
|
||||||
def teardown_server(self, server_details, security_services=None):
|
def teardown_server(self, server_details, security_services=None):
|
||||||
|
@ -646,7 +646,7 @@ class NetAppClusteredShareDriver(driver.NetAppShareDriver):
|
|||||||
.get_children():
|
.get_children():
|
||||||
if snap.get_child_by_name('name').get_content() == snapshot_name\
|
if snap.get_child_by_name('name').get_content() == snapshot_name\
|
||||||
and snap.get_child_by_name('busy').get_content() == 'true':
|
and snap.get_child_by_name('busy').get_content() == 'true':
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _share_unmount(self, share, vserver_client):
|
def _share_unmount(self, share, vserver_client):
|
||||||
"""Unmounts share (required before deleting)."""
|
"""Unmounts share (required before deleting)."""
|
||||||
|
@ -335,7 +335,7 @@ class NetAppShareDriver(driver.ShareDriver):
|
|||||||
for snap in snapshots.get_children():
|
for snap in snapshots.get_children():
|
||||||
if snap.get_child_content('name') == snapshot_name \
|
if snap.get_child_content('name') == snapshot_name \
|
||||||
and snap.get_child_content('busy') == 'true':
|
and snap.get_child_content('busy') == 'true':
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _get_valid_share_name(self, share_id):
|
def _get_valid_share_name(self, share_id):
|
||||||
"""Get share name according to share name template."""
|
"""Get share name according to share name template."""
|
||||||
|
@ -101,38 +101,38 @@ fake_response_service_list = {'services': [
|
|||||||
|
|
||||||
|
|
||||||
class FakeRequest(object):
|
class FakeRequest(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {}
|
GET = {}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithBinary(object):
|
class FakeRequestWithBinary(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"binary": "manila-share"}
|
GET = {"binary": "manila-share"}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithHost(object):
|
class FakeRequestWithHost(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"host": "host1"}
|
GET = {"host": "host1"}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithZone(object):
|
class FakeRequestWithZone(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"zone": "manila1"}
|
GET = {"zone": "manila1"}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithStatus(object):
|
class FakeRequestWithStatus(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"status": "enabled"}
|
GET = {"status": "enabled"}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithState(object):
|
class FakeRequestWithState(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"state": "up"}
|
GET = {"state": "up"}
|
||||||
|
|
||||||
|
|
||||||
class FakeRequestWithHostBinary(object):
|
class FakeRequestWithHostBinary(object):
|
||||||
environ = {"manila.context": context.get_admin_context()}
|
environ = {"manila.context": context.get_admin_context()}
|
||||||
GET = {"host": "host1", "binary": "manila-share"}
|
GET = {"host": "host1", "binary": "manila-share"}
|
||||||
|
|
||||||
|
|
||||||
def fake_service_get_all(context):
|
def fake_service_get_all(context):
|
||||||
|
@ -32,21 +32,21 @@ CONF = cfg.CONF
|
|||||||
|
|
||||||
def _fake_access_get(self, ctxt, access_id):
|
def _fake_access_get(self, ctxt, access_id):
|
||||||
|
|
||||||
class Access(object):
|
class Access(object):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.STATE_NEW = 'fake_new'
|
self.STATE_NEW = 'fake_new'
|
||||||
self.STATE_ACTIVE = 'fake_active'
|
self.STATE_ACTIVE = 'fake_active'
|
||||||
self.STATE_ERROR = 'fake_error'
|
self.STATE_ERROR = 'fake_error'
|
||||||
self.params = kwargs
|
self.params = kwargs
|
||||||
self.params['state'] = self.STATE_NEW
|
self.params['state'] = self.STATE_NEW
|
||||||
self.share_id = kwargs.get('share_id')
|
self.share_id = kwargs.get('share_id')
|
||||||
self.id = access_id
|
self.id = access_id
|
||||||
|
|
||||||
def __getitem__(self, item):
|
def __getitem__(self, item):
|
||||||
return self.params[item]
|
return self.params[item]
|
||||||
|
|
||||||
access = Access(access_id=access_id, share_id='fake_share_id')
|
access = Access(access_id=access_id, share_id='fake_share_id')
|
||||||
return access
|
return access
|
||||||
|
|
||||||
|
|
||||||
class ShareActionsTest(test.TestCase):
|
class ShareActionsTest(test.TestCase):
|
||||||
|
@ -126,14 +126,14 @@ class API(object):
|
|||||||
port['admin_state_up'] = True
|
port['admin_state_up'] = True
|
||||||
port['tenant_id'] = tenant_id
|
port['tenant_id'] = tenant_id
|
||||||
if fixed_ip:
|
if fixed_ip:
|
||||||
fixed_ip_dict = {'ip_address': fixed_ip}
|
fixed_ip_dict = {'ip_address': fixed_ip}
|
||||||
if subnet_id:
|
if subnet_id:
|
||||||
fixed_ip_dict.update({'subnet_id': subnet_id})
|
fixed_ip_dict.update({'subnet_id': subnet_id})
|
||||||
port['fixed_ips'] = [fixed_ip_dict]
|
port['fixed_ips'] = [fixed_ip_dict]
|
||||||
if device_owner:
|
if device_owner:
|
||||||
port['device_owner'] = device_owner
|
port['device_owner'] = device_owner
|
||||||
if device_id:
|
if device_id:
|
||||||
port['device_id'] = device_id
|
port['device_id'] = device_id
|
||||||
return port
|
return port
|
||||||
|
|
||||||
def list_ports(self, **search_opts):
|
def list_ports(self, **search_opts):
|
||||||
|
@ -118,8 +118,8 @@ class TestMigrations(test.TestCase,
|
|||||||
cp.read(self.CONFIG_FILE_PATH)
|
cp.read(self.CONFIG_FILE_PATH)
|
||||||
self.snake_walk = cp.getboolean('walk_style', 'snake_walk')
|
self.snake_walk = cp.getboolean('walk_style', 'snake_walk')
|
||||||
except ConfigParser.ParsingError as e:
|
except ConfigParser.ParsingError as e:
|
||||||
self.fail("Failed to read test_migrations.conf config "
|
self.fail("Failed to read test_migrations.conf config "
|
||||||
"file. Got error: %s" % e)
|
"file. Got error: %s" % e)
|
||||||
|
|
||||||
def _cleanup(self):
|
def _cleanup(self):
|
||||||
shutil.rmtree(os.environ["OSLO_LOCK_PATH"], ignore_errors=True)
|
shutil.rmtree(os.environ["OSLO_LOCK_PATH"], ignore_errors=True)
|
||||||
|
@ -162,7 +162,7 @@ class GlusterfsShareDriverTestCase(test.TestCase):
|
|||||||
glusterfs.LOG.error = Mock()
|
glusterfs.LOG.error = Mock()
|
||||||
|
|
||||||
def exec_runner(*ignore_args, **ignore_kwargs):
|
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']
|
expected_exec = ['gluster volume set testvol nfs.export-volumes off']
|
||||||
fake_utils.fake_execute_set_repliers([(expected_exec[0], exec_runner)])
|
fake_utils.fake_execute_set_repliers([(expected_exec[0], exec_runner)])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user