Improve OpenStack clients API

Change-Id: I53137dcbd38dc7846acbad4364e02a9fb77a4c19
This commit is contained in:
Jean-Emile DARTOIS
2015-11-26 12:10:16 +01:00
parent eb3870a4b3
commit 1300309264
9 changed files with 266 additions and 86 deletions

View File

@@ -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:

View File

@@ -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)