Make resource registration conditional
If client libraries are not present for Swift or Quantum, don't register the corresponding resource types. Change-Id: I95a42973775b7f4c1d82caa47dc0660dfe54bb21 Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
19402ffe80
commit
d9105f57e1
@ -13,6 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from heat.engine import clients
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.engine.resources.quantum import quantum
|
||||
|
||||
@ -72,6 +73,9 @@ class FloatingIPAssociation(quantum.QuantumResource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.quantumclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'OS::Quantum::FloatingIP': FloatingIP,
|
||||
'OS::Quantum::FloatingIPAssociation': FloatingIPAssociation,
|
||||
|
@ -13,6 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from heat.engine import clients
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.engine.resources.quantum import quantum
|
||||
|
||||
@ -46,6 +47,9 @@ class Net(quantum.QuantumResource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.quantumclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'OS::Quantum::Net': Net,
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from heat.engine import clients
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.engine.resources.quantum import quantum
|
||||
|
||||
@ -59,6 +60,9 @@ class Port(quantum.QuantumResource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.quantumclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'OS::Quantum::Port': Port,
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from heat.engine import clients
|
||||
from heat.engine.resources.quantum import quantum
|
||||
|
||||
from heat.openstack.common import log as logging
|
||||
@ -94,6 +95,9 @@ class RouterGateway(quantum.QuantumResource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.quantumclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'OS::Quantum::Router': Router,
|
||||
'OS::Quantum::RouterInterface': RouterInterface,
|
||||
|
@ -13,6 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from heat.engine import clients
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.engine.resources.quantum import quantum
|
||||
|
||||
@ -65,6 +66,9 @@ class Subnet(quantum.QuantumResource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.quantumclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'OS::Quantum::Subnet': Subnet,
|
||||
}
|
||||
|
@ -123,6 +123,9 @@ class S3Bucket(resource.Resource):
|
||||
|
||||
|
||||
def resource_mapping():
|
||||
if clients.swiftclient is None:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'AWS::S3::Bucket': S3Bucket,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user