Merge "Fix bad indentation in manila"
This commit is contained in:
commit
90fd87fdc9
@ -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)
|
||||
|
@ -500,7 +500,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):
|
||||
|
@ -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)."""
|
||||
|
@ -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."""
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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)])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user