# 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
def handle_delete(self):
client = self.quantum()
- client.delete_floatingip(self.resource_id)
+ try:
+ client.delete_floatingip(self.resource_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def FnGetAtt(self, key):
attributes = self.quantum().show_floatingip(
def handle_delete(self):
client = self.quantum()
(floatingip_id, port_id) = self.resource_id.split(':')
- client.update_floatingip(floatingip_id,
- {'floatingip': {'port_id': None}})
+ try:
+ client.update_floatingip(
+ floatingip_id,
+ {'floatingip': {'port_id': None}})
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def resource_mapping():
# 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
def handle_delete(self):
client = self.quantum()
- client.delete_network(self.resource_id)
+ try:
+ client.delete_network(self.resource_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def FnGetAtt(self, key):
attributes = self.quantum().show_network(
# 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
def handle_delete(self):
client = self.quantum()
- client.delete_port(self.resource_id)
+ try:
+ client.delete_port(self.resource_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def FnGetAtt(self, key):
attributes = self.quantum().show_port(
# 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
def handle_delete(self):
client = self.quantum()
- client.delete_router(self.resource_id)
+ try:
+ client.delete_router(self.resource_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def FnGetAtt(self, key):
attributes = self.quantum().show_router(
def handle_create(self):
router_id = self.properties.get('router_id')
subnet_id = self.properties.get('subnet_id')
- self.quantum().add_interface_router(router_id,
- {'subnet_id': subnet_id})
+ self.quantum().add_interface_router(
+ router_id,
+ {'subnet_id': subnet_id})
self.resource_id_set('%s:%s' % (router_id, subnet_id))
def handle_delete(self):
client = self.quantum()
(router_id, subnet_id) = self.resource_id.split(':')
- client.remove_interface_router(router_id,
- {'subnet_id': subnet_id})
+ try:
+ client.remove_interface_router(
+ router_id,
+ {'subnet_id': subnet_id})
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
class RouterGateway(quantum.QuantumResource):
def handle_create(self):
router_id = self.properties.get('router_id')
network_id = self.properties.get('network_id')
- self.quantum().add_gateway_router(router_id,
- {'network_id': network_id})
+ self.quantum().add_gateway_router(
+ router_id,
+ {'network_id': network_id})
self.resource_id_set('%s:%s' % (router_id, network_id))
def handle_delete(self):
client = self.quantum()
(router_id, network_id) = self.resource_id.split(':')
- client.remove_gateway_router(router_id)
+ try:
+ client.remove_gateway_router(router_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def resource_mapping():
# 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
def handle_delete(self):
client = self.quantum()
- client.delete_subnet(self.resource_id)
+ try:
+ client.delete_subnet(self.resource_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def FnGetAtt(self, key):
attributes = self.quantum().show_subnet(
# License for the specific language governing permissions and limitations
# under the License.
+from quantumclient.common.exceptions import QuantumClientException
+
from heat.openstack.common import log as logging
from heat.engine import resource
def handle_delete(self):
client = self.quantum()
(network_id, router_id) = self.resource_id.split(':')
- client.delete_router(router_id)
- client.delete_network(network_id)
+ try:
+ client.delete_router(router_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
+
+ try:
+ client.delete_network(network_id)
+ except QuantumClientException as ex:
+ if ex.status_code != 404:
+ raise ex
def handle_update(self, json_snippet):
return self.UPDATE_REPLACE