diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py index 07dddd28c2..b2f57e7d22 100644 --- a/nova/api/openstack/__init__.py +++ b/nova/api/openstack/__init__.py @@ -314,7 +314,7 @@ class APIRouterV21(base_wsgi.Router): **kargs) if resource.custom_routes_fn: - resource.custom_routes_fn(mapper, wsgi_resource) + resource.custom_routes_fn(mapper, wsgi_resource) def _register_controllers(self, ext): """Register controllers defined by the extensions diff --git a/nova/compute/manager.py b/nova/compute/manager.py index ee0db48542..995deef3d9 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2076,10 +2076,11 @@ class ComputeManager(manager.Manager): yield resources except Exception as exc: with excutils.save_and_reraise_exception() as ctxt: - if not isinstance(exc, (exception.InstanceNotFound, - exception.UnexpectedDeletingTaskStateError)): - LOG.exception(_LE('Instance failed to spawn'), - instance=instance) + if not isinstance(exc, ( + exception.InstanceNotFound, + exception.UnexpectedDeletingTaskStateError)): + LOG.exception(_LE('Instance failed to spawn'), + instance=instance) # Make sure the async call finishes if network_info is not None: network_info.wait(do_raise=False) diff --git a/nova/image/glance.py b/nova/image/glance.py index a90647b2f2..60f27c0ba0 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -84,23 +84,23 @@ def generate_identity_headers(context, status='Confirmed'): def _glanceclient_from_endpoint(context, endpoint, version=1): - """Instantiate a new glanceclient.Client object.""" - params = {} - # NOTE(sdague): even if we aren't using keystone, it doesn't - # hurt to send these headers. - params['identity_headers'] = generate_identity_headers(context) - if endpoint.startswith('https://'): - # https specific params - params['insecure'] = CONF.glance.api_insecure - params['ssl_compression'] = False - sslutils.is_enabled(CONF) - if CONF.ssl.cert_file: - params['cert_file'] = CONF.ssl.cert_file - if CONF.ssl.key_file: - params['key_file'] = CONF.ssl.key_file - if CONF.ssl.ca_file: - params['cacert'] = CONF.ssl.ca_file - return glanceclient.Client(str(version), endpoint, **params) + """Instantiate a new glanceclient.Client object.""" + params = {} + # NOTE(sdague): even if we aren't using keystone, it doesn't + # hurt to send these headers. + params['identity_headers'] = generate_identity_headers(context) + if endpoint.startswith('https://'): + # https specific params + params['insecure'] = CONF.glance.api_insecure + params['ssl_compression'] = False + sslutils.is_enabled(CONF) + if CONF.ssl.cert_file: + params['cert_file'] = CONF.ssl.cert_file + if CONF.ssl.key_file: + params['key_file'] = CONF.ssl.key_file + if CONF.ssl.ca_file: + params['cacert'] = CONF.ssl.ca_file + return glanceclient.Client(str(version), endpoint, **params) def get_api_servers(): diff --git a/nova/network/floating_ips.py b/nova/network/floating_ips.py index fd736f86c4..60633a93bd 100644 --- a/nova/network/floating_ips.py +++ b/nova/network/floating_ips.py @@ -607,10 +607,9 @@ class FloatingIP(object): for dns_domain in domain_list: if (dns_domain.domain in floating_driver_domain_list or dns_domain.domain in instance_driver_domain_list): - domain_entry = self._prepare_domain_entry(context, - dns_domain) - if domain_entry: - domains.append(domain_entry) + domain_entry = self._prepare_domain_entry(context, dns_domain) + if domain_entry: + domains.append(domain_entry) else: LOG.warning(_LW('Database inconsistency: DNS domain |%s| is ' 'registered in the Nova db but not visible to ' diff --git a/nova/objects/numa.py b/nova/objects/numa.py index 15703e6565..4ce040154c 100644 --- a/nova/objects/numa.py +++ b/nova/objects/numa.py @@ -31,7 +31,7 @@ def all_things_equal(obj_a, obj_b): continue if getattr(obj_a, name) != getattr(obj_b, name): - return False + return False return True diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index c6632cf2cd..8f34fc1c37 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -524,15 +524,15 @@ class LibvirtDriver(driver.ComputeDriver): not self._host.has_min_version( MIN_LIBVIRT_OTHER_ARCH.get(kvm_arch), MIN_QEMU_OTHER_ARCH.get(kvm_arch))): - raise exception.NovaException( - _('Running Nova with qemu/kvm virt_type on %(arch)s ' - 'requires libvirt version %(libvirt_ver)s and ' - 'qemu version %(qemu_ver)s, or greater') % - {'arch': kvm_arch, - 'libvirt_ver': self._version_to_string( - MIN_LIBVIRT_OTHER_ARCH.get(kvm_arch)), - 'qemu_ver': self._version_to_string( - MIN_QEMU_OTHER_ARCH.get(kvm_arch))}) + raise exception.NovaException( + _('Running Nova with qemu/kvm virt_type on %(arch)s ' + 'requires libvirt version %(libvirt_ver)s and ' + 'qemu version %(qemu_ver)s, or greater') % + {'arch': kvm_arch, + 'libvirt_ver': self._version_to_string( + MIN_LIBVIRT_OTHER_ARCH.get(kvm_arch)), + 'qemu_ver': self._version_to_string( + MIN_QEMU_OTHER_ARCH.get(kvm_arch))}) def _prepare_migration_flags(self): migration_flags = 0 diff --git a/nova/virt/libvirt/volume/scality.py b/nova/virt/libvirt/volume/scality.py index 93e8a73274..1ee20bcb75 100644 --- a/nova/virt/libvirt/volume/scality.py +++ b/nova/virt/libvirt/volume/scality.py @@ -118,7 +118,7 @@ class LibvirtScalityVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver): parts = mount.split() if (parts[0].endswith('fuse') and parts[1].rstrip('/') == mount_path): - return True + return True return False def _mount_sofs(self):