Merge "Improve OpenStack clients API"
This commit is contained in:
@@ -23,9 +23,9 @@ from oslo_config import cfg
|
||||
from watcher.applier.api.primitive_command import PrimitiveCommand
|
||||
from watcher.applier.api.promise import Promise
|
||||
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
||||
from watcher.common.keystone import Client
|
||||
from watcher.decision_engine.model.hypervisor_state import \
|
||||
HypervisorState
|
||||
|
||||
from watcher.common.keystone import KeystoneClient
|
||||
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -36,7 +36,7 @@ class HypervisorStateCommand(PrimitiveCommand):
|
||||
self.status = status
|
||||
|
||||
def nova_manage_service(self, status):
|
||||
keystone = Client()
|
||||
keystone = KeystoneClient()
|
||||
wrapper = NovaWrapper(keystone.get_credentials(),
|
||||
session=keystone.get_session())
|
||||
if status is True:
|
||||
|
||||
@@ -24,7 +24,8 @@ from oslo_config import cfg
|
||||
from watcher.applier.api.primitive_command import PrimitiveCommand
|
||||
from watcher.applier.api.promise import Promise
|
||||
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
||||
from watcher.common.keystone import Client
|
||||
|
||||
from watcher.common.keystone import KeystoneClient
|
||||
from watcher.decision_engine.planner.default import Primitives
|
||||
|
||||
CONF = cfg.CONF
|
||||
@@ -41,7 +42,7 @@ class MigrateCommand(PrimitiveCommand):
|
||||
self.destination_hypervisor = destination_hypervisor
|
||||
|
||||
def migrate(self, destination):
|
||||
keystone = Client()
|
||||
keystone = KeystoneClient()
|
||||
wrapper = NovaWrapper(keystone.get_credentials(),
|
||||
session=keystone.get_session())
|
||||
instance = wrapper.find_instance(self.instance_uuid)
|
||||
|
||||
Reference in New Issue
Block a user