Fixes minor issues

Fix some word spellings in messages.
Do not log twice with different level.
config options: use nova.conf.
Remove unused CONF imports.
Remove unused logging import and LOG global var.
Add transitional support for migrate data objects.

Change-Id: I34006a82c134398f17512de7e7b6c52980460521
This commit is contained in:
Claudiu Belu
2016-02-24 17:46:28 +02:00
parent 51d15cff6e
commit cb34a86abf
6 changed files with 13 additions and 21 deletions

View File

@@ -18,12 +18,12 @@ Image caching and management.
import os
import re
import nova.conf
from nova import exception
from nova import utils
from nova.virt import imagecache
from nova.virt import images
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import units
@@ -34,7 +34,7 @@ from hyperv.nova import pathutils
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF = nova.conf.CONF
CONF.import_opt('use_cow_images', 'nova.virt.driver')
CONF.import_opt('instances_path', 'nova.compute.manager')
CONF.import_opt('remove_unused_original_minimum_age_seconds',

View File

@@ -18,8 +18,9 @@ Management class for live migration VM operations.
"""
import functools
import nova.conf
from nova.objects import migrate_data as migrate_data_obj
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
@@ -32,8 +33,7 @@ from hyperv.nova import vmops
from hyperv.nova import volumeops
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('use_cow_images', 'nova.virt.driver')
CONF = nova.conf.CONF
def check_os_version_requirement(function):
@@ -122,7 +122,7 @@ class LiveMigrationOps(object):
block_migration=False,
disk_over_commit=False):
LOG.debug("check_can_live_migrate_destination called", instance_ref)
return {}
return migrate_data_obj.LiveMigrateData()
@check_os_version_requirement
def check_can_live_migrate_destination_cleanup(self, ctxt,

View File

@@ -19,13 +19,10 @@ import time
from nova import exception
from os_win.utils import pathutils
from oslo_config import cfg
from oslo_log import log as logging
from hyperv.i18n import _
from hyperv.nova import constants
LOG = logging.getLogger(__name__)
hyperv_opts = [
cfg.StrOpt('instances_path_share',
default="",

View File

@@ -24,13 +24,11 @@ from nova.image import glance
from nova import utils
from os_win import exceptions as os_win_exc
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from hyperv.i18n import _LW
from hyperv.i18n import _LE
from hyperv.nova import pathutils
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@@ -60,7 +58,7 @@ class SnapshotOps(object):
try:
instance_synchronized_snapshot()
except os_win_exc.HyperVVMNotFoundException:
# the instance might dissapear before starting the operation.
# the instance might disappear before starting the operation.
raise exception.InstanceNotFound(instance_id=instance.uuid)
def _snapshot(self, context, instance, image_id, update_task_state):
@@ -129,10 +127,9 @@ class SnapshotOps(object):
try:
LOG.debug("Removing snapshot %s", image_id)
self._vmutils.remove_vm_snapshot(snapshot_path)
except Exception as ex:
LOG.exception(ex)
LOG.warning(_LW('Failed to remove snapshot for VM %s'),
instance_name)
except Exception:
LOG.exception(_LE('Failed to remove snapshot for VM %s'),
instance_name, instance=instance)
if export_dir:
LOG.debug('Removing directory: %s', export_dir)
self._pathutils.rmtree(export_dir)

View File

@@ -20,7 +20,6 @@ from nova.i18n import _
from nova.network import model as network_model
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from hyperv.nova import ovsutils
@@ -36,8 +35,6 @@ CONF = cfg.CONF
CONF.register_opts(hyperv_opts, 'hyperv')
CONF.import_opt('network_api_class', 'nova.network')
LOG = logging.getLogger(__name__)
class HyperVBaseVIFDriver(object):
@abc.abstractmethod

View File

@@ -24,6 +24,7 @@ import time
from eventlet import timeout as etimeout
from nova.api.metadata import base as instance_metadata
from nova.compute import vm_states
import nova.conf
from nova import exception
from nova import objects
from nova import utils
@@ -95,7 +96,7 @@ hyperv_opts = [
'RDS-Virtualization feature has to be enabled')
]
CONF = cfg.CONF
CONF = nova.conf.CONF
CONF.register_opts(hyperv_opts, 'hyperv')
CONF.import_opt('use_cow_images', 'nova.virt.driver')