diff --git a/watcher/applier/rpcapi.py b/watcher/applier/rpcapi.py index bbf2903f7..607d3882e 100644 --- a/watcher/applier/rpcapi.py +++ b/watcher/applier/rpcapi.py @@ -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 diff --git a/watcher/common/nova_helper.py b/watcher/common/nova_helper.py index bb237d323..ce8ebd8b3 100644 --- a/watcher/common/nova_helper.py +++ b/watcher/common/nova_helper.py @@ -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 diff --git a/watcher/common/service.py b/watcher/common/service.py index 0f6055cfe..89a34aa9c 100644 --- a/watcher/common/service.py +++ b/watcher/common/service.py @@ -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}) diff --git a/watcher/db/sqlalchemy/migration.py b/watcher/db/sqlalchemy/migration.py index 6cd020af6..6d34341b4 100644 --- a/watcher/db/sqlalchemy/migration.py +++ b/watcher/db/sqlalchemy/migration.py @@ -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 diff --git a/watcher/doc.py b/watcher/doc.py index ec91a6420..0db9fb172 100644 --- a/watcher/doc.py +++ b/watcher/doc.py @@ -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)