Merge "Add Blazar custom constraint plugin"
This commit is contained in:
@@ -15,7 +15,9 @@ from blazarclient import client as blazar_client
|
|||||||
from blazarclient import exception as client_exception
|
from blazarclient import exception as client_exception
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
from heat.common import exception
|
||||||
from heat.engine.clients import client_plugin
|
from heat.engine.clients import client_plugin
|
||||||
|
from heat.engine import constraints
|
||||||
|
|
||||||
CLIENT_NAME = 'blazar'
|
CLIENT_NAME = 'blazar'
|
||||||
|
|
||||||
@@ -58,3 +60,16 @@ class BlazarClientPlugin(client_plugin.ClientPlugin):
|
|||||||
|
|
||||||
def get_host(self, id):
|
def get_host(self, id):
|
||||||
return self.client().host.get(id)
|
return self.client().host.get(id)
|
||||||
|
|
||||||
|
|
||||||
|
class BlazarBaseConstraint(constraints.BaseCustomConstraint):
|
||||||
|
|
||||||
|
resource_client_name = CLIENT_NAME
|
||||||
|
|
||||||
|
|
||||||
|
class ReservationConstraint(BlazarBaseConstraint):
|
||||||
|
expected_exceptions = (
|
||||||
|
exception.EntityNotFound,
|
||||||
|
client_exception.BlazarClientException,)
|
||||||
|
|
||||||
|
resource_getter_name = 'get_lease'
|
||||||
|
@@ -108,6 +108,7 @@ heat.constraints =
|
|||||||
# service constraints
|
# service constraints
|
||||||
barbican.container = heat.engine.clients.os.barbican:ContainerConstraint
|
barbican.container = heat.engine.clients.os.barbican:ContainerConstraint
|
||||||
barbican.secret = heat.engine.clients.os.barbican:SecretConstraint
|
barbican.secret = heat.engine.clients.os.barbican:SecretConstraint
|
||||||
|
blazar.reservation = heat.engine.clients.os.blazar:ReservationConstraint
|
||||||
cinder.backup = heat.engine.clients.os.cinder:VolumeBackupConstraint
|
cinder.backup = heat.engine.clients.os.cinder:VolumeBackupConstraint
|
||||||
cinder.qos_specs = heat.engine.clients.os.cinder:QoSSpecsConstraint
|
cinder.qos_specs = heat.engine.clients.os.cinder:QoSSpecsConstraint
|
||||||
cinder.snapshot = heat.engine.clients.os.cinder:VolumeSnapshotConstraint
|
cinder.snapshot = heat.engine.clients.os.cinder:VolumeSnapshotConstraint
|
||||||
|
Reference in New Issue
Block a user