# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
+from heat.engine import clients
from heat.common import exception
from heat.openstack.common import log as logging
from heat.engine import resource
'network_id': external_network_id})
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
vpc = self.stack[self.properties.get('VpcId')]
for router_id in vpc.metadata['all_router_ids']:
def resource_mapping():
+ if clients.quantumclient is None:
+ return {}
+
return {
'AWS::EC2::InternetGateway': InternetGateway,
'AWS::EC2::VPCGatewayAttachment': VPCGatewayAttachment,
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
+from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine import resource
self.metadata = md
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
try:
client.delete_port(self.metadata['port_id'])
def resource_mapping():
+ if clients.quantumclient is None:
+ return {}
+
return {
'AWS::EC2::NetworkInterface': NetworkInterface,
}
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine.resources.quantum import quantum
+if clients.quantumclient is not None:
+ from quantumclient.common.exceptions import QuantumClientException
+
logger = logging.getLogger(__name__)
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine.resources.quantum import quantum
self.resource_id_set(net['id'])
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
try:
client.delete_network(self.resource_id)
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine.resources.quantum import quantum
self.resource_id_set(port['id'])
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
try:
client.delete_port(self.resource_id)
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
from heat.engine import clients
from heat.engine.resources.quantum import quantum
+if clients.quantumclient is not None:
+ from quantumclient.common.exceptions import QuantumClientException
+
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine.resources.quantum import quantum
self.resource_id_set(subnet['id'])
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
try:
client.delete_subnet(self.resource_id)
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
+from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine import resource
+if clients.quantumclient is not None:
+ from quantumclient.common.exceptions import QuantumClientException
+
logger = logging.getLogger(__name__)
def resource_mapping():
+ if clients.quantumclient is None:
+ return {}
+
return {
'AWS::EC2::RouteTable': RouteTable,
'AWS::EC2::SubnetRouteTableAssocation': SubnetRouteTableAssocation,
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
+from heat.engine import clients
from heat.common import exception
from heat.openstack.common import log as logging
from heat.engine import resource
self.metadata = md
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
router_id = self.metadata['router_id']
subnet_id = self.metadata['subnet_id']
def resource_mapping():
+ if clients.quantumclient is None:
+ return {}
+
return {
'AWS::EC2::Subnet': Subnet,
}
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
-
+from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine import resource
self.metadata = md
def handle_delete(self):
+ from quantumclient.common.exceptions import QuantumClientException
+
client = self.quantum()
network_id = self.metadata['network_id']
router_id = self.metadata['router_id']
def resource_mapping():
+ if clients.quantumclient is None:
+ return {}
+
return {
'AWS::EC2::VPC': VPC,
}
from heat.engine import parser
import heat.engine.resources
-from quantumclient.common.exceptions import QuantumClientException
-from quantumclient.v2_0 import client as quantumclient
+try:
+ from quantumclient.common.exceptions import QuantumClientException
+ from quantumclient.v2_0 import client as quantumclient
+except ImportError:
+ from nose.exc import SkipTest
+ raise SkipTest()
class VPCTestBase(unittest.TestCase):