Remove unused function and argument
I removed the unused function and (function)argument in code Change-Id: Ib7afa5d868c3c7769f53e45c270850e4c3370f86
This commit is contained in:
@@ -63,10 +63,3 @@ class ApplierAPI(messaging_core.MessagingCore):
|
|||||||
return self.client.call(
|
return self.client.call(
|
||||||
context.to_dict(), 'launch_action_plan',
|
context.to_dict(), 'launch_action_plan',
|
||||||
action_plan_uuid=action_plan_uuid)
|
action_plan_uuid=action_plan_uuid)
|
||||||
|
|
||||||
def event_receive(self, event):
|
|
||||||
try:
|
|
||||||
pass
|
|
||||||
except Exception as e:
|
|
||||||
LOG.exception(e)
|
|
||||||
raise
|
|
||||||
|
|||||||
@@ -265,58 +265,6 @@ class NovaHelper(object):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def built_in_non_live_migrate_instance(self, instance_id, hypervisor_id):
|
|
||||||
"""This method does a live migration of a given instance
|
|
||||||
|
|
||||||
This method uses the Nova built-in non-live migrate()
|
|
||||||
action to migrate a given instance.
|
|
||||||
It returns True if the migration was successful, False otherwise.
|
|
||||||
|
|
||||||
:param instance_id: the unique id of the instance to migrate.
|
|
||||||
"""
|
|
||||||
|
|
||||||
LOG.debug(
|
|
||||||
"Trying a Nova built-in non-live "
|
|
||||||
"migrate of instance %s ..." % instance_id)
|
|
||||||
|
|
||||||
# Looking for the instance to migrate
|
|
||||||
instance = self.find_instance(instance_id)
|
|
||||||
|
|
||||||
if not instance:
|
|
||||||
LOG.debug("Instance not found: %s" % instance_id)
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
host_name = getattr(instance, 'OS-EXT-SRV-ATTR:host')
|
|
||||||
LOG.debug(
|
|
||||||
"Instance %s found on host '%s'." % (instance_id, host_name))
|
|
||||||
|
|
||||||
instance.migrate()
|
|
||||||
|
|
||||||
# Poll at 5 second intervals, until the status is as expected
|
|
||||||
if self.wait_for_instance_status(instance,
|
|
||||||
('VERIFY_RESIZE', 'ERROR'),
|
|
||||||
5, 10):
|
|
||||||
|
|
||||||
instance = self.nova.servers.get(instance.id)
|
|
||||||
|
|
||||||
if instance.status == 'VERIFY_RESIZE':
|
|
||||||
host_name = getattr(instance, 'OS-EXT-SRV-ATTR:host')
|
|
||||||
LOG.debug(
|
|
||||||
"Instance %s has been successfully "
|
|
||||||
"migrated to host '%s'." % (
|
|
||||||
instance_id, host_name))
|
|
||||||
|
|
||||||
# We need to confirm that the resize() operation
|
|
||||||
# has succeeded in order to
|
|
||||||
# get back instance state to 'ACTIVE'
|
|
||||||
instance.confirm_resize()
|
|
||||||
|
|
||||||
return True
|
|
||||||
elif instance.status == 'ERROR':
|
|
||||||
LOG.debug("Instance %s migration failed" % instance_id)
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def live_migrate_instance(self, instance_id, dest_hostname,
|
def live_migrate_instance(self, instance_id, dest_hostname,
|
||||||
block_migration=False, retry=120):
|
block_migration=False, retry=120):
|
||||||
"""This method does a live migration of a given instance
|
"""This method does a live migration of a given instance
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class RPCService(service.Service):
|
|||||||
'%(host)s.'),
|
'%(host)s.'),
|
||||||
{'service': self.topic, 'host': self.host})
|
{'service': self.topic, 'host': self.host})
|
||||||
|
|
||||||
def _handle_signal(self, signo, frame):
|
def _handle_signal(self):
|
||||||
LOG.info(_LI('Got signal SIGUSR1. Not deregistering on next shutdown '
|
LOG.info(_LI('Got signal SIGUSR1. Not deregistering on next shutdown '
|
||||||
'of service %(service)s on host %(host)s.'),
|
'of service %(service)s on host %(host)s.'),
|
||||||
{'service': self.topic, 'host': self.host})
|
{'service': self.topic, 'host': self.host})
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def _alembic_config():
|
|||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
def version(config=None, engine=None):
|
def version(engine=None):
|
||||||
"""Current database version.
|
"""Current database version.
|
||||||
|
|
||||||
:returns: Database version
|
:returns: Database version
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class WatcherTerm(rst.Directive):
|
|||||||
# You need to put an import path as an argument for this directive to work
|
# You need to put an import path as an argument for this directive to work
|
||||||
required_arguments = 1
|
required_arguments = 1
|
||||||
|
|
||||||
def add_textblock(self, textblock, *lineno):
|
def add_textblock(self, textblock):
|
||||||
for line in textblock.splitlines():
|
for line in textblock.splitlines():
|
||||||
self.add_line(line)
|
self.add_line(line)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user