diff --git a/manila/api/v1/share_manage.py b/manila/api/v1/share_manage.py index a16cfcdd..faac2f74 100644 --- a/manila/api/v1/share_manage.py +++ b/manila/api/v1/share_manage.py @@ -36,9 +36,9 @@ class ShareManageMixin(object): # DB layers for 'name' and 'description' API params that are # represented in DB as 'display_name' and 'display_description' # appropriately. - name = share_data.get('display_name', share_data.get('name', None)) + name = share_data.get('display_name', share_data.get('name')) description = share_data.get( - 'display_description', share_data.get('description', None)) + 'display_description', share_data.get('description')) share = { 'host': share_data['service_host'], diff --git a/manila/api/v2/share_types.py b/manila/api/v2/share_types.py index 6615c98d..74128b32 100644 --- a/manila/api/v2/share_types.py +++ b/manila/api/v2/share_types.py @@ -141,7 +141,7 @@ class ShareTypesController(wsgi.Controller): share_type = body['share_type'] else: share_type = body['volume_type'] - name = share_type.get('name', None) + name = share_type.get('name') specs = share_type.get('extra_specs', {}) is_public = share_type.get( 'os-share-type-access:is_public', diff --git a/manila/scheduler/drivers/filter.py b/manila/scheduler/drivers/filter.py index b7d2c18d..fbc45c2b 100644 --- a/manila/scheduler/drivers/filter.py +++ b/manila/scheduler/drivers/filter.py @@ -65,7 +65,7 @@ class FilterScheduler(base.Scheduler): In the event that the request gets re-scheduled, this entry will signal that the given backend has already been tried. """ - retry = filter_properties.get('retry', None) + retry = filter_properties.get('retry') if not retry: return hosts = retry['hosts'] @@ -278,7 +278,7 @@ class FilterScheduler(base.Scheduler): if not exc: return # no exception info from a previous attempt, skip - hosts = retry.get('hosts', None) + hosts = retry.get('hosts') if not hosts: return # no previously attempted hosts, skip @@ -388,7 +388,7 @@ class FilterScheduler(base.Scheduler): """ elevated = context.elevated() - shr_types = request_spec.get("share_types", None) + shr_types = request_spec.get("share_types") weighed_hosts = [] diff --git a/manila/scheduler/filters/retry.py b/manila/scheduler/filters/retry.py index 3eb210ba..c28d4a7f 100644 --- a/manila/scheduler/filters/retry.py +++ b/manila/scheduler/filters/retry.py @@ -25,7 +25,7 @@ class RetryFilter(base_host.BaseHostFilter): def host_passes(self, host_state, filter_properties): """Skip nodes that have already been attempted.""" - retry = filter_properties.get('retry', None) + retry = filter_properties.get('retry') if not retry: # Re-scheduling is disabled LOG.debug("Re-scheduling is disabled")