Merge "Remove unused function and argument"

This commit is contained in:
Jenkins
2016-02-19 01:01:10 +00:00
committed by Gerrit Code Review
5 changed files with 3 additions and 62 deletions

View File

@@ -63,10 +63,3 @@ class ApplierAPI(messaging_core.MessagingCore):
return self.client.call(
context.to_dict(), 'launch_action_plan',
action_plan_uuid=action_plan_uuid)
def event_receive(self, event):
try:
pass
except Exception as e:
LOG.exception(e)
raise

View File

@@ -265,58 +265,6 @@ class NovaHelper(object):
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,
block_migration=False, retry=120):
"""This method does a live migration of a given instance

View File

@@ -102,7 +102,7 @@ class RPCService(service.Service):
'%(host)s.'),
{'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 '
'of service %(service)s on host %(host)s.'),
{'service': self.topic, 'host': self.host})

View File

@@ -32,7 +32,7 @@ def _alembic_config():
return config
def version(config=None, engine=None):
def version(engine=None):
"""Current database version.
:returns: Database version

View File

@@ -47,7 +47,7 @@ class WatcherTerm(rst.Directive):
# You need to put an import path as an argument for this directive to work
required_arguments = 1
def add_textblock(self, textblock, *lineno):
def add_textblock(self, textblock):
for line in textblock.splitlines():
self.add_line(line)