quantumclient is gone upstream and has been replaced by neutronclient.
This patch retains the OS::Quantum::XX namespace
Fixes: bug #1197208
Change-Id: Id48f9598ea1884132d411ad533770ae49494102b
* https://github.com/openstack/python-novaclient (instance)
* https://github.com/openstack/python-keystoneclient (auth)
* https://github.com/openstack/python-swiftclient (s3)
-* https://github.com/openstack/python-quantumclient (networking)
+* https://github.com/openstack/python-neutronclient (networking)
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml"
version="5.0"
- xml:id="quantum-cli-reference">
+ xml:id="neutron-cli-reference">
<?dbhtml stop-chunking?>
<title>OpenStack Heat CLI Guide</title>
<para>This section describes heat commands</para>
swiftclient = None
logger.info('swiftclient not available')
try:
- from quantumclient.v2_0 import client as quantumclient
+ from neutronclient.v2_0 import client as neutronclient
except ImportError:
- quantumclient = None
- logger.info('quantumclient not available')
+ neutronclient = None
+ logger.info('neutronclient not available')
try:
from cinderclient import client as cinderclient
except ImportError:
self._nova = {}
self._keystone = None
self._swift = None
- self._quantum = None
+ self._neutron = None
self._cinder = None
self._ceilometer = None
self._swift = swiftclient.Connection(**args)
return self._swift
- def quantum(self):
- if quantumclient is None:
+ def neutron(self):
+ if neutronclient is None:
return None
- if self._quantum:
- return self._quantum
+ if self._neutron:
+ return self._neutron
con = self.context
if self.auth_token is None:
- logger.error("Quantum connection failed, no auth_token!")
+ logger.error("Neutron connection failed, no auth_token!")
return None
args = {
'endpoint_url': self.url_for(service_type='network')
}
- self._quantum = quantumclient.Client(**args)
+ self._neutron = neutronclient.Client(**args)
- return self._quantum
+ return self._neutron
def cinder(self):
if cinderclient is None:
def swift(self):
return self.stack.clients.swift()
- def quantum(self):
- return self.stack.clients.quantum()
+ def neutron(self):
+ return self.stack.clients.neutron()
def cinder(self):
return self.stack.clients.cinder()
else:
# if SubnetId property in Instance, ensure subnet exists
if subnet_id:
- quantumclient = self.quantum()
+ neutronclient = self.neutron()
network_id = NetworkInterface.network_id_from_subnet_id(
- quantumclient, subnet_id)
+ neutronclient, subnet_id)
# if subnet verified, create a port to use this subnet
# if port is not created explicitly, nova will choose
# the first subnet in the given network.
'network_id': network_id,
'fixed_ips': [fixed_ip]
}
- port = quantumclient.create_port({'port': props})['port']
+ port = neutronclient.create_port({'port': props})['port']
nics = [{'port-id': port['id']}]
return nics
deps += (self, route_table)
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
external_network_id = InternetGateway.get_external_network_id(client)
for router in self._vpc_route_tables():
client.add_gateway_router(router.resource_id, {
'network_id': external_network_id})
def handle_delete(self):
- from quantumclient.common.exceptions import QuantumClientException
+ from neutronclient.common.exceptions import NeutronClientException
- client = self.quantum()
+ client = self.neutron()
for router in self._vpc_route_tables():
try:
client.remove_gateway_router(router.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
}
@staticmethod
- def network_id_from_subnet_id(quantumclient, subnet_id):
- subnet_info = quantumclient.show_subnet(subnet_id)
+ def network_id_from_subnet_id(neutronclient, subnet_id):
+ subnet_info = neutronclient.show_subnet(subnet_id)
return subnet_info['subnet']['network_id']
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
subnet_id = self.properties['SubnetId']
network_id = self.network_id_from_subnet_id(client, subnet_id)
self.resource_id_set(port['id'])
def handle_delete(self):
- from quantumclient.common.exceptions import QuantumClientException
+ from neutronclient.common.exceptions import NeutronClientException
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_port(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
from heat.engine import clients
from heat.openstack.common import log as logging
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
logger = logging.getLogger(__name__)
-class FloatingIP(quantum.QuantumResource):
+class FloatingIP(neutron.NeutronResource):
properties_schema = {'floating_network_id': {'Type': 'String',
'Required': True},
'value_specs': {'Type': 'Map',
# depend on any RouterGateway in this template with the same
# network_id as this floating_network_id
for resource in self.stack.resources.itervalues():
- if (resource.type() == 'OS::Quantum::RouterGateway' and
+ if ((resource.type() == 'OS::Neutron::RouterGateway' or
+ resource.type() == 'OS::Quantum::RouterGateway') and
resource.properties.get('network_id') ==
self.properties.get('floating_network_id')):
deps += (self, resource)
props = self.prepare_properties(
self.properties,
self.physical_resource_name())
- fip = self.quantum().create_floatingip({
+ fip = self.neutron().create_floatingip({
'floatingip': props})['floatingip']
self.resource_id_set(fip['id'])
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_floatingip(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def FnGetAtt(self, key):
try:
- attributes = self.quantum().show_floatingip(
+ attributes = self.neutron().show_floatingip(
self.resource_id)['floatingip']
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
logger.warn("failed to fetch resource attributes: %s" % str(ex))
return None
return self.handle_get_attributes(self.name, key, attributes)
-class FloatingIPAssociation(quantum.QuantumResource):
+class FloatingIPAssociation(neutron.NeutronResource):
properties_schema = {'floatingip_id': {'Type': 'String',
'Required': True},
'port_id': {'Type': 'String',
floatingip_id = props.pop('floatingip_id')
- self.quantum().update_floatingip(floatingip_id, {
+ self.neutron().update_floatingip(floatingip_id, {
'floatingip': props})['floatingip']
self.resource_id_set('%s:%s' % (floatingip_id, props['port_id']))
def handle_delete(self):
if not self.resource_id:
return
- client = self.quantum()
+ client = self.neutron()
(floatingip_id, port_id) = self.resource_id.split(':')
try:
client.update_floatingip(
floatingip_id,
{'floatingip': {'port_id': None}})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
+ 'OS::Neutron::FloatingIP': FloatingIP,
+ 'OS::Neutron::FloatingIPAssociation': FloatingIPAssociation,
'OS::Quantum::FloatingIP': FloatingIP,
'OS::Quantum::FloatingIPAssociation': FloatingIPAssociation,
}
from heat.engine import clients
from heat.openstack.common import log as logging
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
from heat.engine import scheduler
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
logger = logging.getLogger(__name__)
-class Net(quantum.QuantumResource):
+class Net(neutron.NeutronResource):
properties_schema = {'name': {'Type': 'String'},
'value_specs': {'Type': 'Map',
'Default': {}},
props = self.prepare_properties(
self.properties,
self.physical_resource_name())
- net = self.quantum().create_network({'network': props})['network']
+ net = self.neutron().create_network({'network': props})['network']
self.resource_id_set(net['id'])
def _show_resource(self):
- return self.quantum().show_network(
+ return self.neutron().show_network(
self.resource_id)['network']
def check_create_complete(self, *args):
return self.is_built(attributes)
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_network(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
else:
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
+ 'OS::Neutron::Net': Net,
'OS::Quantum::Net': Net,
}
# License for the specific language governing permissions and limitations
# under the License.
-from quantumclient.common.exceptions import QuantumClientException
+from neutronclient.common.exceptions import NeutronClientException
from heat.common import exception
from heat.engine import resource
logger = logging.getLogger(__name__)
-class QuantumResource(resource.Resource):
+class NeutronResource(resource.Resource):
def validate(self):
'''
Validate any of the provided params
'''
- res = super(QuantumResource, self).validate()
+ res = super(NeutronResource, self).validate()
if res:
return res
return self.validate_properties(self.properties)
def prepare_properties(properties, name):
'''
Prepares the property values so that they can be passed directly to
- the Quantum call.
+ the Neutron call.
Removes None values and value_specs, merges value_specs with the main
values.
return True
else:
raise exception.Error('%s resource[%s] status[%s]' %
- ('quantum reported unexpected',
+ ('neutron reported unexpected',
attributes['name'], attributes['status']))
def _resolve_attribute(self, name):
try:
attributes = self._show_resource()
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
logger.warn("failed to fetch resource attributes: %s" % str(ex))
return None
return self.handle_get_attributes(self.name, name, attributes)
try:
yield
self._show_resource()
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
return
from heat.engine import clients
from heat.openstack.common import log as logging
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
from heat.engine import scheduler
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
logger = logging.getLogger(__name__)
-class Port(quantum.QuantumResource):
+class Port(neutron.NeutronResource):
fixed_ip_schema = {'subnet_id': {'Type': 'String',
'Required': True},
# to so all subnets in a network should be created before
# the ports in that network.
for resource in self.stack.resources.itervalues():
- if (resource.type() == 'OS::Quantum::Subnet' and
+ if ((resource.type() == 'OS::Neutron::Subnet' or
+ resource.type() == 'OS::Quantum::Subnet') and
resource.properties.get('network_id') ==
self.properties.get('network_id')):
deps += (self, resource)
props = self.prepare_properties(
self.properties,
self.physical_resource_name())
- port = self.quantum().create_port({'port': props})['port']
+ port = self.neutron().create_port({'port': props})['port']
self.resource_id_set(port['id'])
def _show_resource(self):
- return self.quantum().show_port(
+ return self.neutron().show_port(
self.resource_id)['port']
def check_create_complete(self, *args):
return self.is_built(attributes)
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_port(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
else:
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
+ 'OS::Neutron::Port': Port,
'OS::Quantum::Port': Port,
}
# under the License.
from heat.engine import clients
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
from heat.engine import scheduler
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)
-class Router(quantum.QuantumResource):
+class Router(neutron.NeutronResource):
properties_schema = {'name': {'Type': 'String'},
'value_specs': {'Type': 'Map',
'Default': {}},
props = self.prepare_properties(
self.properties,
self.physical_resource_name())
- router = self.quantum().create_router({'router': props})['router']
+ router = self.neutron().create_router({'router': props})['router']
self.resource_id_set(router['id'])
def _show_resource(self):
- return self.quantum().show_router(
+ return self.neutron().show_router(
self.resource_id)['router']
def check_create_complete(self, *args):
return self.is_built(attributes)
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_router(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
else:
return scheduler.TaskRunner(self._confirm_delete)()
-class RouterInterface(quantum.QuantumResource):
+class RouterInterface(neutron.NeutronResource):
properties_schema = {'router_id': {'Type': 'String',
'Required': True},
'subnet_id': {'Type': 'String',
def handle_create(self):
router_id = self.properties.get('router_id')
subnet_id = self.properties.get('subnet_id')
- self.quantum().add_interface_router(
+ self.neutron().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()
+ client = self.neutron()
(router_id, subnet_id) = self.resource_id.split(':')
try:
client.remove_interface_router(
router_id,
{'subnet_id': subnet_id})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
-class RouterGateway(quantum.QuantumResource):
+class RouterGateway(neutron.NeutronResource):
properties_schema = {'router_id': {'Type': 'String',
'Required': True},
'network_id': {'Type': 'String',
for resource in self.stack.resources.itervalues():
# depend on any RouterInterface in this template with the same
# router_id as this router_id
- if (resource.type() == 'OS::Quantum::RouterInterface' and
+ if ((resource.type() == 'OS::Neutron::RouterInterface' or
+ resource.type() == 'OS::Quantum::RouterInterface') and
resource.properties.get('router_id') ==
self.properties.get('router_id')):
deps += (self, resource)
# depend on any subnet in this template with the same network_id
# as this network_id, as the gateway implicitly creates a port
# on that subnet
- elif (resource.type() == 'OS::Quantum::Subnet' and
+ elif ((resource.type() == 'OS::Neutron::Subnet' or
+ resource.type() == 'OS::Quantum::Subnet') and
resource.properties.get('network_id') ==
self.properties.get('network_id')):
deps += (self, resource)
def handle_create(self):
router_id = self.properties.get('router_id')
network_id = self.properties.get('network_id')
- self.quantum().add_gateway_router(
+ self.neutron().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()
+ client = self.neutron()
(router_id, network_id) = self.resource_id.split(':')
try:
client.remove_gateway_router(router_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
+ 'OS::Neutron::Router': Router,
+ 'OS::Neutron::RouterInterface': RouterInterface,
+ 'OS::Neutron::RouterGateway': RouterGateway,
'OS::Quantum::Router': Router,
'OS::Quantum::RouterInterface': RouterInterface,
'OS::Quantum::RouterGateway': RouterGateway,
from heat.engine import clients
from heat.openstack.common import log as logging
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
from heat.engine import scheduler
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
logger = logging.getLogger(__name__)
-class Subnet(quantum.QuantumResource):
+class Subnet(neutron.NeutronResource):
allocation_schema = {'start': {'Type': 'String',
'Required': True},
props = self.prepare_properties(
self.properties,
self.physical_resource_name())
- subnet = self.quantum().create_subnet({'subnet': props})['subnet']
+ subnet = self.neutron().create_subnet({'subnet': props})['subnet']
self.resource_id_set(subnet['id'])
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
try:
client.delete_subnet(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
else:
return scheduler.TaskRunner(self._confirm_delete)()
def _show_resource(self):
- return self.quantum().show_subnet(self.resource_id)['subnet']
+ return self.neutron().show_subnet(self.resource_id)['subnet']
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
+ 'OS::Neutron::Subnet': Subnet,
'OS::Quantum::Subnet': Subnet,
}
return self._cloud_blockstore
- def quantum(self):
- '''Rackspace quantum client.'''
+ def neutron(self):
+ '''Rackspace neutron client.'''
if not self._cloud_nw:
self.__authenticate()
self._cloud_nw = self.pyrax.cloud_networks
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine import resource
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
from heat.engine.resources.vpc import VPC
-if clients.quantumclient is not None:
- from quantumclient.common.exceptions import QuantumClientException
+if clients.neutronclient is not None:
+ from neutronclient.common.exceptions import NeutronClientException
logger = logging.getLogger(__name__)
}
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
props = {'name': self.physical_resource_name()}
router = client.create_router({'router': props})['router']
self.resource_id_set(router['id'])
def check_create_complete(self, *args):
- client = self.quantum()
+ client = self.neutron()
attributes = client.show_router(
self.resource_id)['router']
- if not quantum.QuantumResource.is_built(attributes):
+ if not neutron.NeutronResource.is_built(attributes):
return False
network_id = self.properties.get('VpcId')
return True
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
router_id = self.resource_id
try:
client.delete_router(router_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
# just in case this router has been added to a gateway, remove it
try:
client.remove_gateway_router(router_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
}
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
subnet_id = self.properties.get('SubnetId')
router_id = self.properties.get('RouteTableId')
client.remove_interface_router(
previous_router['id'],
{'subnet_id': subnet_id})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
router_id, {'subnet_id': subnet_id})
def _router_for_subnet(self, subnet_id):
- client = self.quantum()
+ client = self.neutron()
subnet = client.show_subnet(
subnet_id)['subnet']
network_id = subnet['network_id']
return VPC.router_for_vpc(client, network_id)
def handle_delete(self):
- client = self.quantum()
+ client = self.neutron()
subnet_id = self.properties.get('SubnetId')
router_id = self.properties.get('RouteTableId')
try:
client.remove_interface_router(router_id, {
'subnet_id': subnet_id})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
if default_router:
client.add_interface_router(
default_router['id'], {'subnet_id': subnet_id})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
'SecurityGroupEgress': {'Type': 'List'}}
def handle_create(self):
- if self.properties['VpcId'] and clients.quantumclient is not None:
- self._handle_create_quantum()
+ if self.properties['VpcId'] and clients.neutronclient is not None:
+ self._handle_create_neutron()
else:
self._handle_create_nova()
- def _handle_create_quantum(self):
- from quantumclient.common.exceptions import QuantumClientException
- client = self.quantum()
+ def _handle_create_neutron(self):
+ from neutronclient.common.exceptions import NeutronClientException
+ client = self.neutron()
sec = client.create_security_group({'security_group': {
'name': self.physical_resource_name(),
self.resource_id_set(sec['id'])
if self.properties['SecurityGroupIngress']:
for i in self.properties['SecurityGroupIngress']:
- # Quantum only accepts positive ints
+ # Neutron only accepts positive ints
if int(i['FromPort']) < 0:
i['FromPort'] = None
if int(i['ToPort']) < 0:
'security_group_id': sec['id']
}
})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code == 409:
# no worries, the rule is already there
pass
'security_group_id': sec['id']
}
})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code == 409:
# no worries, the rule is already there
pass
raise
def handle_delete(self):
- if self.properties['VpcId'] and clients.quantumclient is not None:
- self._handle_delete_quantum()
+ if self.properties['VpcId'] and clients.neutronclient is not None:
+ self._handle_delete_neutron()
else:
self._handle_delete_nova()
self.nova().security_groups.delete(self.resource_id)
self.resource_id = None
- def _handle_delete_quantum(self):
- from quantumclient.common.exceptions import QuantumClientException
- client = self.quantum()
+ def _handle_delete_neutron(self):
+ from neutronclient.common.exceptions import NeutronClientException
+ client = self.neutron()
if self.resource_id is not None:
try:
sec = client.show_security_group(
self.resource_id)['security_group']
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise
else:
for rule in sec['security_group_rules']:
try:
client.delete_security_group_rule(rule['id'])
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise
try:
client.delete_security_group(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise
self.resource_id = None
}
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
# TODO(sbaker) Verify that this CidrBlock is within the vpc CidrBlock
network_id = self.properties.get('VpcId')
}
subnet = client.create_subnet({'subnet': props})['subnet']
- router = VPC.router_for_vpc(self.quantum(), network_id)
+ router = VPC.router_for_vpc(self.neutron(), network_id)
if router:
client.add_interface_router(
router['id'],
self.resource_id_set(subnet['id'])
def handle_delete(self):
- from quantumclient.common.exceptions import QuantumClientException
+ from neutronclient.common.exceptions import NeutronClientException
- client = self.quantum()
+ client = self.neutron()
network_id = self.properties.get('VpcId')
subnet_id = self.resource_id
try:
- router = VPC.router_for_vpc(self.quantum(), network_id)
+ router = VPC.router_for_vpc(self.neutron(), network_id)
if router:
client.remove_interface_router(
router['id'],
{'subnet_id': subnet_id})
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
try:
client.delete_subnet(subnet_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
from heat.engine import clients
from heat.openstack.common import log as logging
from heat.engine import resource
-from heat.engine.resources.quantum import quantum
+from heat.engine.resources.neutron import neutron
logger = logging.getLogger(__name__)
}
def handle_create(self):
- client = self.quantum()
+ client = self.neutron()
# The VPC's net and router are associated by having identical names.
net_props = {'name': self.physical_resource_name()}
router_props = {'name': self.physical_resource_name()}
@staticmethod
def router_for_vpc(client, network_id):
- # first get the quantum net
+ # first get the neutron net
net = VPC.network_for_vpc(client, network_id)
# then find a router with the same name
routers = client.list_routers(name=net['name'])['routers']
return routers[0]
def check_create_complete(self, *args):
- net = self.network_for_vpc(self.quantum(), self.resource_id)
- if not quantum.QuantumResource.is_built(net):
+ net = self.network_for_vpc(self.neutron(), self.resource_id)
+ if not neutron.NeutronResource.is_built(net):
return False
- router = self.router_for_vpc(self.quantum(), self.resource_id)
- return quantum.QuantumResource.is_built(router)
+ router = self.router_for_vpc(self.neutron(), self.resource_id)
+ return neutron.NeutronResource.is_built(router)
def handle_delete(self):
- from quantumclient.common.exceptions import QuantumClientException
- client = self.quantum()
+ from neutronclient.common.exceptions import NeutronClientException
+ client = self.neutron()
router = self.router_for_vpc(client, self.resource_id)
try:
client.delete_router(router['id'])
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
try:
client.delete_network(self.resource_id)
- except QuantumClientException as ex:
+ except NeutronClientException as ex:
if ex.status_code != 404:
raise ex
def resource_mapping():
- if clients.quantumclient is None:
+ if clients.neutronclient is None:
return {}
return {
{
"AWSTemplateFormatVersion" : "2010-09-09",
- "Description" : "Template to test Quantum resources",
+ "Description" : "Template to test Neutron resources",
"Parameters" : {
"Resources" : {
"network": {
- "Type": "OS::Quantum::Net",
+ "Type": "OS::Neutron::Net",
"Properties": {
"name": "the_network"
}
},
"unnamed_network": {
- "Type": "OS::Quantum::Net"
+ "Type": "OS::Neutron::Net"
},
"admin_down_network": {
- "Type": "OS::Quantum::Net",
+ "Type": "OS::Neutron::Net",
"Properties": {
"admin_state_up": false
}
},
"subnet": {
- "Type": "OS::Quantum::Subnet",
+ "Type": "OS::Neutron::Subnet",
"Properties": {
"network_id": { "Ref" : "network" },
"ip_version": 4,
},
"port": {
- "Type": "OS::Quantum::Port",
+ "Type": "OS::Neutron::Port",
"Properties": {
"device_id": "d6b4d3a5-c700-476f-b609-1493dd9dadc0",
"name": "port1",
},
"router": {
- "Type": "OS::Quantum::Router"
+ "Type": "OS::Neutron::Router"
},
"router_interface": {
- "Type": "OS::Quantum::RouterInterface",
+ "Type": "OS::Neutron::RouterInterface",
"Properties": {
"router_id": { "Ref" : "router" },
"subnet_id": { "Ref" : "subnet" }
"Description" : "All attributes for router"
}
}
-}
\ No newline at end of file
+}
HeatTemplateFormatVersion: '2012-12-12'
-Description: Template to test Quantum resources
+Description: Template to test Neutron resources
Resources:
network:
- Type: OS::Quantum::Net
+ Type: OS::Neutron::Net
Properties: {name: the_network}
unnamed_network:
- Type: 'OS::Quantum::Net'
+ Type: 'OS::Neutron::Net'
admin_down_network:
- Type: OS::Quantum::Net
+ Type: OS::Neutron::Net
Properties: {admin_state_up: false}
subnet:
- Type: OS::Quantum::Subnet
+ Type: OS::Neutron::Subnet
Properties:
network_id: {Ref: network}
ip_version: 4
allocation_pools:
- {end: 10.0.3.150, start: 10.0.3.20}
port:
- Type: OS::Quantum::Port
+ Type: OS::Neutron::Port
Properties:
device_id: d6b4d3a5-c700-476f-b609-1493dd9dadc0
name: port1
- subnet_id: {Ref: subnet}
ip_address: 10.0.3.21
router:
- Type: 'OS::Quantum::Router'
+ Type: 'OS::Neutron::Router'
router_interface:
- Type: OS::Quantum::RouterInterface
+ Type: OS::Neutron::RouterInterface
Properties:
router_id: {Ref: router}
subnet_id: {Ref: subnet}
'''
-class FakeQuantum(object):
+class FakeNeutron(object):
def show_subnet(self, subnet, **_params):
return {
self.m.StubOutWithMock(instance, 'nova')
instance.nova().MultipleTimes().AndReturn(self.fc)
- self.m.StubOutWithMock(instance, 'quantum')
- instance.quantum().MultipleTimes().AndReturn(FakeQuantum())
+ self.m.StubOutWithMock(instance, 'neutron')
+ instance.neutron().MultipleTimes().AndReturn(FakeNeutron())
instance.t = instance.stack.resolve_runtime_data(instance.t)
instance = instances.Instance('%s_name' % name,
t['Resources']['WebServer'], stack)
- self.m.StubOutWithMock(nic, 'quantum')
- nic.quantum().MultipleTimes().AndReturn(FakeQuantum())
+ self.m.StubOutWithMock(nic, 'neutron')
+ nic.neutron().MultipleTimes().AndReturn(FakeNeutron())
self.m.StubOutWithMock(instance, 'nova')
instance.nova().MultipleTimes().AndReturn(self.fc)
from heat.engine import properties
from heat.engine import resource
from heat.engine import scheduler
-from heat.engine.resources.quantum import net
-from heat.engine.resources.quantum import subnet
-from heat.engine.resources.quantum import router
-from heat.engine.resources.quantum.quantum import QuantumResource as qr
+from heat.engine.resources.neutron import net
+from heat.engine.resources.neutron import subnet
+from heat.engine.resources.neutron import router
+from heat.engine.resources.neutron.neutron import NeutronResource as qr
from heat.openstack.common.importutils import try_import
from heat.tests.common import HeatTestCase
from heat.tests import fakes
from heat.tests.utils import setup_dummy_db
from heat.tests.utils import parse_stack
-quantumclient = try_import('quantumclient.v2_0.client')
-qe = try_import('quantumclient.common.exceptions')
+neutronclient = try_import('neutronclient.v2_0.client')
+qe = try_import('neutronclient.common.exceptions')
-quantum_template = '''
+neutron_template = '''
{
"AWSTemplateFormatVersion" : "2010-09-09",
- "Description" : "Template to test Quantum resources",
+ "Description" : "Template to test Neutron resources",
"Parameters" : {},
"Resources" : {
"network": {
- "Type": "OS::Quantum::Net",
+ "Type": "OS::Neutron::Net",
"Properties": {
"name": "the_network"
}
},
"unnamed_network": {
- "Type": "OS::Quantum::Net"
+ "Type": "OS::Neutron::Net"
},
"admin_down_network": {
- "Type": "OS::Quantum::Net",
+ "Type": "OS::Neutron::Net",
"Properties": {
"admin_state_up": false
}
},
"subnet": {
- "Type": "OS::Quantum::Subnet",
+ "Type": "OS::Neutron::Subnet",
"Properties": {
"network_id": { "Ref" : "network" },
"ip_version": 4,
}
},
"port": {
- "Type": "OS::Quantum::Port",
+ "Type": "OS::Neutron::Port",
"Properties": {
"device_id": "d6b4d3a5-c700-476f-b609-1493dd9dadc0",
"name": "port1",
}
},
"port2": {
- "Type": "OS::Quantum::Port",
+ "Type": "OS::Neutron::Port",
"Properties": {
"name": "port2",
"network_id": { "Ref" : "network" }
}
},
"router": {
- "Type": "OS::Quantum::Router"
+ "Type": "OS::Neutron::Router"
},
"router_interface": {
- "Type": "OS::Quantum::RouterInterface",
+ "Type": "OS::Neutron::RouterInterface",
"Properties": {
"router_id": { "Ref" : "router" },
"subnet_id": { "Ref" : "subnet" }
}
},
"gateway": {
- "Type": "OS::Quantum::RouterGateway",
+ "Type": "OS::Neutron::RouterGateway",
"Properties": {
"router_id": { "Ref" : "router" },
"network_id": { "Ref" : "network" }
}
'''
-quantum_floating_template = '''
+neutron_floating_template = '''
{
"AWSTemplateFormatVersion" : "2010-09-09",
- "Description" : "Template to test Quantum resources",
+ "Description" : "Template to test Neutron resources",
"Parameters" : {},
"Resources" : {
"port_floating": {
- "Type": "OS::Quantum::Port",
+ "Type": "OS::Neutron::Port",
"Properties": {
"network_id": "xyz1234",
"fixed_ips": [{
}
},
"floating_ip": {
- "Type": "OS::Quantum::FloatingIP",
+ "Type": "OS::Neutron::FloatingIP",
"Properties": {
"floating_network_id": "abcd1234",
}
},
"floating_ip_assoc": {
- "Type": "OS::Quantum::FloatingIPAssociation",
+ "Type": "OS::Neutron::FloatingIPAssociation",
"Properties": {
"floatingip_id": { "Ref" : "floating_ip" },
"port_id": { "Ref" : "port_floating" }
}
},
"router": {
- "Type": "OS::Quantum::Router"
+ "Type": "OS::Neutron::Router"
},
"gateway": {
- "Type": "OS::Quantum::RouterGateway",
+ "Type": "OS::Neutron::RouterGateway",
"Properties": {
"router_id": { "Ref" : "router" },
"network_id": "abcd1234"
'''
-class QuantumTest(HeatTestCase):
+class NeutronTest(HeatTestCase):
def test_validate_properties(self):
vs = {'router:external': True}
})
-@skipIf(quantumclient is None, 'quantumclient unavailable')
-class QuantumNetTest(HeatTestCase):
+@skipIf(neutronclient is None, 'neutronclient unavailable')
+class NeutronNetTest(HeatTestCase):
def setUp(self):
- super(QuantumNetTest, self).setUp()
- self.m.StubOutWithMock(quantumclient.Client, 'create_network')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_network')
- self.m.StubOutWithMock(quantumclient.Client, 'show_network')
+ super(NeutronNetTest, self).setUp()
+ self.m.StubOutWithMock(neutronclient.Client, 'create_network')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_network')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_network')
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
setup_dummy_db()
def test_net(self):
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_network({
+ neutronclient.Client.create_network({
'network': {'name': u'the_network', 'admin_state_up': True}
}).AndReturn({"network": {
"status": "BUILD",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({"network": {
"status": "BUILD",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({"network": {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({"network": {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({"network": {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.delete_network(
+ neutronclient.Client.delete_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn(None)
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_network(
+ neutronclient.Client.delete_network(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
stack = parse_stack(t)
rsrc = self.create_net(t, stack, 'network')
self.m.VerifyAll()
-@skipIf(quantumclient is None, 'quantumclient unavailable')
-class QuantumSubnetTest(HeatTestCase):
+@skipIf(neutronclient is None, 'neutronclient unavailable')
+class NeutronSubnetTest(HeatTestCase):
def setUp(self):
- super(QuantumSubnetTest, self).setUp()
- self.m.StubOutWithMock(quantumclient.Client, 'create_subnet')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_subnet')
- self.m.StubOutWithMock(quantumclient.Client, 'show_subnet')
+ super(NeutronSubnetTest, self).setUp()
+ self.m.StubOutWithMock(neutronclient.Client, 'create_subnet')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_subnet')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_subnet')
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
setup_dummy_db()
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_subnet({
+ neutronclient.Client.create_subnet({
'subnet': {
'name': utils.PhysName('test_stack', 'test_subnet'),
'network_id': u'None',
"tenant_id": "c1210485b2424d48804aad5d39c61b8f"
}
})
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1').AndRaise(
- qe.QuantumClientException(status_code=404))
+ qe.NeutronClientException(status_code=404))
sn = {
"subnet": {
"name": "name",
"enable_dhcp": True,
}
}
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1').AndReturn(sn)
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1').AndReturn(sn)
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1').AndReturn(sn)
- quantumclient.Client.delete_subnet(
+ neutronclient.Client.delete_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1'
).AndReturn(None)
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_subnet(
+ neutronclient.Client.delete_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
stack = parse_stack(t)
rsrc = self.create_subnet(t, stack, 'subnet')
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_subnet({
+ neutronclient.Client.create_subnet({
'subnet': {
'name': utils.PhysName('test_stack', 'test_subnet'),
'network_id': u'None',
}
})
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1').AndReturn({
"subnet": {
"name": "name",
}
})
- quantumclient.Client.delete_subnet(
+ neutronclient.Client.delete_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1'
).AndReturn(None)
- quantumclient.Client.show_subnet(
+ neutronclient.Client.show_subnet(
'91e47a57-7508-46fe-afc9-fc454e8580e1'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
t['Resources']['subnet']['Properties']['enable_dhcp'] = 'False'
stack = parse_stack(t)
rsrc = self.create_subnet(t, stack, 'subnet')
self.m.VerifyAll()
-@skipIf(quantumclient is None, 'quantumclient unavailable')
-class QuantumRouterTest(HeatTestCase):
+@skipIf(neutronclient is None, 'neutronclient unavailable')
+class NeutronRouterTest(HeatTestCase):
def setUp(self):
- super(QuantumRouterTest, self).setUp()
- self.m.StubOutWithMock(quantumclient.Client, 'create_router')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_router')
- self.m.StubOutWithMock(quantumclient.Client, 'show_router')
- self.m.StubOutWithMock(quantumclient.Client, 'add_interface_router')
- self.m.StubOutWithMock(quantumclient.Client, 'remove_interface_router')
- self.m.StubOutWithMock(quantumclient.Client, 'add_gateway_router')
- self.m.StubOutWithMock(quantumclient.Client, 'remove_gateway_router')
+ super(NeutronRouterTest, self).setUp()
+ self.m.StubOutWithMock(neutronclient.Client, 'create_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'add_interface_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'remove_interface_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'add_gateway_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'remove_gateway_router')
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
setup_dummy_db()
def test_router(self):
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_router({
+ neutronclient.Client.create_router({
'router': {
'name': utils.PhysName('test_stack', 'router'),
'admin_state_up': True,
"id": "3e46229d-8fce-4733-819a-b5fe630550f8"
}
})
- quantumclient.Client.show_router(
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8').AndReturn({
"router": {
"status": "BUILD",
"id": "3e46229d-8fce-4733-819a-b5fe630550f8"
}
})
- quantumclient.Client.show_router(
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8').AndReturn({
"router": {
"status": "ACTIVE",
}
})
- quantumclient.Client.show_router(
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8').AndRaise(
- qe.QuantumClientException(status_code=404))
- quantumclient.Client.show_router(
+ qe.NeutronClientException(status_code=404))
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8').AndReturn({
"router": {
"status": "ACTIVE",
"id": "3e46229d-8fce-4733-819a-b5fe630550f8"
}
})
- quantumclient.Client.show_router(
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8').AndReturn({
"router": {
"status": "ACTIVE",
}
})
- quantumclient.Client.delete_router(
+ neutronclient.Client.delete_router(
'3e46229d-8fce-4733-819a-b5fe630550f8'
).AndReturn(None)
- quantumclient.Client.show_router(
+ neutronclient.Client.show_router(
'3e46229d-8fce-4733-819a-b5fe630550f8'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_router(
+ neutronclient.Client.delete_router(
'3e46229d-8fce-4733-819a-b5fe630550f8'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
stack = parse_stack(t)
rsrc = self.create_router(t, stack, 'router')
def test_router_interface(self):
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.add_interface_router(
+ neutronclient.Client.add_interface_router(
'3e46229d-8fce-4733-819a-b5fe630550f8',
{'subnet_id': '91e47a57-7508-46fe-afc9-fc454e8580e1'}
).AndReturn(None)
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
'3e46229d-8fce-4733-819a-b5fe630550f8',
{'subnet_id': '91e47a57-7508-46fe-afc9-fc454e8580e1'}
).AndReturn(None)
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
'3e46229d-8fce-4733-819a-b5fe630550f8',
{'subnet_id': '91e47a57-7508-46fe-afc9-fc454e8580e1'}
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
stack = parse_stack(t)
rsrc = self.create_router_interface(
def test_gateway_router(self):
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.add_gateway_router(
+ neutronclient.Client.add_gateway_router(
'3e46229d-8fce-4733-819a-b5fe630550f8',
{'network_id': 'fc68ea2c-b60b-4b4f-bd82-94ec81110766'}
).AndReturn(None)
- quantumclient.Client.remove_gateway_router(
+ neutronclient.Client.remove_gateway_router(
'3e46229d-8fce-4733-819a-b5fe630550f8'
).AndReturn(None)
- quantumclient.Client.remove_gateway_router(
+ neutronclient.Client.remove_gateway_router(
'3e46229d-8fce-4733-819a-b5fe630550f8'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_template)
+ t = template_format.parse(neutron_template)
stack = parse_stack(t)
rsrc = self.create_gateway_router(
self.m.VerifyAll()
-@skipIf(quantumclient is None, 'quantumclient unavailable')
-class QuantumFloatingIPTest(HeatTestCase):
- @skipIf(net.clients.quantumclient is None, "Missing Quantum Client")
+@skipIf(neutronclient is None, 'neutronclient unavailable')
+class NeutronFloatingIPTest(HeatTestCase):
+ @skipIf(net.clients.neutronclient is None, "Missing Neutron Client")
def setUp(self):
- super(QuantumFloatingIPTest, self).setUp()
- self.m.StubOutWithMock(quantumclient.Client, 'create_floatingip')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_floatingip')
- self.m.StubOutWithMock(quantumclient.Client, 'show_floatingip')
- self.m.StubOutWithMock(quantumclient.Client, 'update_floatingip')
- self.m.StubOutWithMock(quantumclient.Client, 'create_port')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_port')
- self.m.StubOutWithMock(quantumclient.Client, 'show_port')
+ super(NeutronFloatingIPTest, self).setUp()
+ self.m.StubOutWithMock(neutronclient.Client, 'create_floatingip')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_floatingip')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_floatingip')
+ self.m.StubOutWithMock(neutronclient.Client, 'update_floatingip')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_port')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_port')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_port')
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
setup_dummy_db()
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_floatingip({
+ neutronclient.Client.create_floatingip({
'floatingip': {'floating_network_id': u'abcd1234'}
}).AndReturn({'floatingip': {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_floatingip(
+ neutronclient.Client.show_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
- quantumclient.Client.show_floatingip(
+ ).AndRaise(qe.NeutronClientException(status_code=404))
+ neutronclient.Client.show_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).MultipleTimes().AndReturn({'floatingip': {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.delete_floatingip(
+ neutronclient.Client.delete_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndReturn(None)
- quantumclient.Client.delete_floatingip(
+ neutronclient.Client.delete_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766').AndRaise(
- qe.QuantumClientException(status_code=404))
+ qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_floating_template)
+ t = template_format.parse(neutron_floating_template)
stack = parse_stack(t)
# assert the implicit dependency between the floating_ip
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_port({'port': {
+ neutronclient.Client.create_port({'port': {
'network_id': u'xyz1234',
'fixed_ips': [
{'subnet_id': u'12.12.12.0', 'ip_address': u'10.0.0.10'}
"status": "BUILD",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_port(
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({'port': {
"status": "BUILD",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_port(
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({'port': {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_port(
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
- quantumclient.Client.show_port(
+ ).AndRaise(qe.NeutronClientException(status_code=404))
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).MultipleTimes().AndReturn({'port': {
"status": "ACTIVE",
self.m.ReplayAll()
- t = template_format.parse(quantum_floating_template)
+ t = template_format.parse(neutron_floating_template)
stack = parse_stack(t)
p = stack['port_floating']
clients.OpenStackClients.keystone().AndReturn(
fakes.FakeKeystoneClient())
- quantumclient.Client.create_floatingip({
+ neutronclient.Client.create_floatingip({
'floatingip': {'floating_network_id': u'abcd1234'}
}).AndReturn({'floatingip': {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.create_port({'port': {
+ neutronclient.Client.create_port({'port': {
'network_id': u'xyz1234',
'fixed_ips': [
{'subnet_id': u'12.12.12.0', 'ip_address': u'10.0.0.10'}
"status": "BUILD",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.show_port(
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn({'port': {
"status": "ACTIVE",
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.update_floatingip(
+ neutronclient.Client.update_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
{
'floatingip': {
"id": "fc68ea2c-b60b-4b4f-bd82-94ec81110766"
}})
- quantumclient.Client.update_floatingip(
+ neutronclient.Client.update_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
{'floatingip': {
'port_id': None
}}).AndReturn(None)
- quantumclient.Client.delete_port(
+ neutronclient.Client.delete_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn(None)
- quantumclient.Client.show_port(
+ neutronclient.Client.show_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_floatingip(
+ neutronclient.Client.delete_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
).AndReturn(None)
- quantumclient.Client.update_floatingip(
+ neutronclient.Client.update_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766',
{'floatingip': {
'port_id': None
- }}).AndRaise(qe.QuantumClientException(status_code=404))
+ }}).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_port(
+ neutronclient.Client.delete_port(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
- quantumclient.Client.delete_floatingip(
+ neutronclient.Client.delete_floatingip(
'fc68ea2c-b60b-4b4f-bd82-94ec81110766'
- ).AndRaise(qe.QuantumClientException(status_code=404))
+ ).AndRaise(qe.NeutronClientException(status_code=404))
self.m.ReplayAll()
- t = template_format.parse(quantum_floating_template)
+ t = template_format.parse(neutron_floating_template)
stack = parse_stack(t)
fip = stack['floating_ip']
from novaclient.v1_1 import security_groups as nova_sg
from novaclient.v1_1 import security_group_rules as nova_sgr
-from quantumclient.common.exceptions import QuantumClientException
-from quantumclient.v2_0 import client as quantumclient
+from neutronclient.common.exceptions import NeutronClientException
+from neutronclient.v2_0 import client as neutronclient
NovaSG = collections.namedtuple('NovaSG',
' '.join([
CidrIp : 0.0.0.0/0
'''
- test_template_quantum = '''
+ test_template_neutron = '''
HeatTemplateFormatVersion: '2012-12-12'
Resources:
the_sg:
self.m.StubOutWithMock(nova_sg.SecurityGroupManager, 'get')
self.m.StubOutWithMock(nova_sg.SecurityGroupManager, 'list')
setup_dummy_db()
- self.m.StubOutWithMock(quantumclient.Client, 'create_security_group')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_security_group')
self.m.StubOutWithMock(
- quantumclient.Client, 'create_security_group_rule')
- self.m.StubOutWithMock(quantumclient.Client, 'show_security_group')
+ neutronclient.Client, 'create_security_group_rule')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_security_group')
self.m.StubOutWithMock(
- quantumclient.Client, 'delete_security_group_rule')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_security_group')
+ neutronclient.Client, 'delete_security_group_rule')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_security_group')
def create_stack(self, template):
t = template_format.parse(template)
self.m.VerifyAll()
@stack_delete_after
- def test_security_group_quantum(self):
+ def test_security_group_neutron(self):
#create script
clients.OpenStackClients.keystone().AndReturn(
FakeKeystoneClient())
sg_name = utils.PhysName('test_stack', 'the_sg')
- quantumclient.Client.create_security_group({
+ neutronclient.Client.create_security_group({
'security_group': {
'name': sg_name,
'description': 'HTTP and SSH access'
}
})
- quantumclient.Client.create_security_group_rule({
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'ingress',
'remote_ip_prefix': '0.0.0.0/0',
'id': 'bbbb'
}
})
- quantumclient.Client.create_security_group_rule({
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'ingress',
'remote_ip_prefix': '0.0.0.0/0',
'id': 'cccc'
}
})
- quantumclient.Client.create_security_group_rule({
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'egress',
'remote_ip_prefix': '10.0.1.0/24',
})
# delete script
- quantumclient.Client.show_security_group('aaaa').AndReturn({
+ neutronclient.Client.show_security_group('aaaa').AndReturn({
'security_group': {
'tenant_id': 'f18ca530cc05425e8bac0a5ff92f7e88',
'name': 'sc1',
'port_range_min': 22
}],
'id': 'aaaa'}})
- quantumclient.Client.delete_security_group_rule('bbbb').AndReturn(None)
- quantumclient.Client.delete_security_group_rule('cccc').AndReturn(None)
- quantumclient.Client.delete_security_group_rule('dddd').AndReturn(None)
- quantumclient.Client.delete_security_group('aaaa').AndReturn(None)
+ neutronclient.Client.delete_security_group_rule('bbbb').AndReturn(None)
+ neutronclient.Client.delete_security_group_rule('cccc').AndReturn(None)
+ neutronclient.Client.delete_security_group_rule('dddd').AndReturn(None)
+ neutronclient.Client.delete_security_group('aaaa').AndReturn(None)
self.m.ReplayAll()
- stack = self.create_stack(self.test_template_quantum)
+ stack = self.create_stack(self.test_template_neutron)
sg = stack['the_sg']
self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
self.m.VerifyAll()
@stack_delete_after
- def test_security_group_quantum_exception(self):
+ def test_security_group_neutron_exception(self):
#create script
clients.OpenStackClients.keystone().AndReturn(
FakeKeystoneClient())
sg_name = utils.PhysName('test_stack', 'the_sg')
- quantumclient.Client.create_security_group({
+ neutronclient.Client.create_security_group({
'security_group': {
'name': sg_name,
'description': 'HTTP and SSH access'
}
})
- quantumclient.Client.create_security_group_rule({
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'ingress',
'remote_ip_prefix': '0.0.0.0/0',
'security_group_id': 'aaaa'
}
}).AndRaise(
- QuantumClientException(status_code=409))
- quantumclient.Client.create_security_group_rule({
+ NeutronClientException(status_code=409))
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'ingress',
'remote_ip_prefix': '0.0.0.0/0',
'security_group_id': 'aaaa'
}
}).AndRaise(
- QuantumClientException(status_code=409))
- quantumclient.Client.create_security_group_rule({
+ NeutronClientException(status_code=409))
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'egress',
'remote_ip_prefix': '10.0.1.0/24',
'security_group_id': 'aaaa'
}
}).AndRaise(
- QuantumClientException(status_code=409))
+ NeutronClientException(status_code=409))
# delete script
- quantumclient.Client.show_security_group('aaaa').AndReturn({
+ neutronclient.Client.show_security_group('aaaa').AndReturn({
'security_group': {
'tenant_id': 'f18ca530cc05425e8bac0a5ff92f7e88',
'name': 'sc1',
'port_range_min': 22
}],
'id': 'aaaa'}})
- quantumclient.Client.delete_security_group_rule('bbbb').AndRaise(
- QuantumClientException(status_code=404))
- quantumclient.Client.delete_security_group_rule('cccc').AndRaise(
- QuantumClientException(status_code=404))
- quantumclient.Client.delete_security_group_rule('dddd').AndRaise(
- QuantumClientException(status_code=404))
- quantumclient.Client.delete_security_group('aaaa').AndRaise(
- QuantumClientException(status_code=404))
-
- quantumclient.Client.show_security_group('aaaa').AndRaise(
- QuantumClientException(status_code=404))
+ neutronclient.Client.delete_security_group_rule('bbbb').AndRaise(
+ NeutronClientException(status_code=404))
+ neutronclient.Client.delete_security_group_rule('cccc').AndRaise(
+ NeutronClientException(status_code=404))
+ neutronclient.Client.delete_security_group_rule('dddd').AndRaise(
+ NeutronClientException(status_code=404))
+ neutronclient.Client.delete_security_group('aaaa').AndRaise(
+ NeutronClientException(status_code=404))
+
+ neutronclient.Client.show_security_group('aaaa').AndRaise(
+ NeutronClientException(status_code=404))
self.m.ReplayAll()
- stack = self.create_stack(self.test_template_quantum)
+ stack = self.create_stack(self.test_template_neutron)
sg = stack['the_sg']
self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
for key in stack1.resources:
self.assertEqual(stack1.resources[key].t, stack2.resources[key].t)
- @skipIf(clients.quantumclient is None, 'quantumclient unavailable')
- def test_quantum_resolved(self):
- self.compare_stacks('Quantum.template', 'Quantum.yaml', {})
+ @skipIf(clients.neutronclient is None, 'neutronclient unavailable')
+ def test_neutron_resolved(self):
+ self.compare_stacks('Neutron.template', 'Neutron.yaml', {})
def test_wordpress_resolved(self):
self.compare_stacks('WordPress_Single_Instance.template',
from heat.tests.utils import setup_dummy_db
try:
- from quantumclient.common.exceptions import QuantumClientException
- from quantumclient.v2_0 import client as quantumclient
+ from neutronclient.common.exceptions import NeutronClientException
+ from neutronclient.v2_0 import client as neutronclient
except ImportError:
- quantumclient = None
+ neutronclient = None
class VPCTestBase(HeatTestCase):
- @skipIf(quantumclient is None, 'quantumclient unavaialble')
+ @skipIf(neutronclient is None, 'neutronclient unavaialble')
def setUp(self):
super(VPCTestBase, self).setUp()
setup_dummy_db()
- self.m.StubOutWithMock(quantumclient.Client, 'add_interface_router')
- self.m.StubOutWithMock(quantumclient.Client, 'add_gateway_router')
- self.m.StubOutWithMock(quantumclient.Client, 'create_network')
- self.m.StubOutWithMock(quantumclient.Client, 'create_port')
- self.m.StubOutWithMock(quantumclient.Client, 'create_router')
- self.m.StubOutWithMock(quantumclient.Client, 'create_subnet')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_network')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_port')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_router')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_subnet')
- self.m.StubOutWithMock(quantumclient.Client, 'list_networks')
- self.m.StubOutWithMock(quantumclient.Client, 'list_routers')
- self.m.StubOutWithMock(quantumclient.Client, 'remove_gateway_router')
- self.m.StubOutWithMock(quantumclient.Client, 'remove_interface_router')
- self.m.StubOutWithMock(quantumclient.Client, 'show_subnet')
- self.m.StubOutWithMock(quantumclient.Client, 'show_network')
- self.m.StubOutWithMock(quantumclient.Client, 'show_router')
- self.m.StubOutWithMock(quantumclient.Client, 'create_security_group')
- self.m.StubOutWithMock(quantumclient.Client, 'show_security_group')
- self.m.StubOutWithMock(quantumclient.Client, 'delete_security_group')
+ self.m.StubOutWithMock(neutronclient.Client, 'add_interface_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'add_gateway_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_network')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_port')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_subnet')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_network')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_port')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_subnet')
+ self.m.StubOutWithMock(neutronclient.Client, 'list_networks')
+ self.m.StubOutWithMock(neutronclient.Client, 'list_routers')
+ self.m.StubOutWithMock(neutronclient.Client, 'remove_gateway_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'remove_interface_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_subnet')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_network')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_router')
+ self.m.StubOutWithMock(neutronclient.Client, 'create_security_group')
+ self.m.StubOutWithMock(neutronclient.Client, 'show_security_group')
+ self.m.StubOutWithMock(neutronclient.Client, 'delete_security_group')
self.m.StubOutWithMock(
- quantumclient.Client, 'create_security_group_rule')
+ neutronclient.Client, 'create_security_group_rule')
self.m.StubOutWithMock(
- quantumclient.Client, 'delete_security_group_rule')
+ neutronclient.Client, 'delete_security_group_rule')
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
def create_stack(self, template):
def mock_create_network(self):
self.vpc_name = utils.PhysName('test_stack', 'the_vpc')
- quantumclient.Client.create_network(
+ neutronclient.Client.create_network(
{
'network': {'name': self.vpc_name}
}).AndReturn({'network': {
'tenant_id': 'c1210485b2424d48804aad5d39c61b8f',
'id': 'aaaa'
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'aaaa'
).AndReturn({"network": {
"status": "BUILD",
"id": "aaaa"
}})
- quantumclient.Client.show_network(
+ neutronclient.Client.show_network(
'aaaa'
).MultipleTimes().AndReturn({"network": {
"status": "ACTIVE",
"tenant_id": "c1210485b2424d48804aad5d39c61b8f",
"id": "aaaa"
}})
- quantumclient.Client.create_router(
+ neutronclient.Client.create_router(
{'router': {'name': self.vpc_name}}).AndReturn({
'router': {
'status': 'BUILD',
'tenant_id': 'c1210485b2424d48804aad5d39c61b8f',
'id': 'bbbb'
}})
- quantumclient.Client.list_routers(name=self.vpc_name).AndReturn({
+ neutronclient.Client.list_routers(name=self.vpc_name).AndReturn({
"routers": [{
"status": "BUILD",
"external_gateway_info": None,
def mock_create_subnet(self):
self.subnet_name = utils.PhysName('test_stack', 'the_subnet')
- quantumclient.Client.create_subnet(
+ neutronclient.Client.create_subnet(
{'subnet': {
'network_id': u'aaaa',
'cidr': u'10.0.0.0/24',
'tenant_id': 'c1210485b2424d48804aad5d39c61b8f',
'id': 'cccc'}})
self.mock_router_for_vpc()
- quantumclient.Client.add_interface_router(
+ neutronclient.Client.add_interface_router(
u'bbbb',
{'subnet_id': 'cccc'}).AndReturn(None)
def mock_show_subnet(self):
- quantumclient.Client.show_subnet('cccc').AndReturn({
+ neutronclient.Client.show_subnet('cccc').AndReturn({
'subnet': {
'name': self.subnet_name,
'network_id': 'aaaa',
def mock_create_security_group(self):
self.sg_name = utils.PhysName('test_stack', 'the_sg')
- quantumclient.Client.create_security_group({
+ neutronclient.Client.create_security_group({
'security_group': {
'name': self.sg_name,
'description': 'SSH access'
}
})
- quantumclient.Client.create_security_group_rule({
+ neutronclient.Client.create_security_group_rule({
'security_group_rule': {
'direction': 'ingress',
'remote_ip_prefix': '0.0.0.0/0',
def mock_delete_security_group(self):
sg_name = utils.PhysName('test_stack', 'the_sg')
- quantumclient.Client.show_security_group('eeee').AndReturn({
+ neutronclient.Client.show_security_group('eeee').AndReturn({
'security_group': {
'tenant_id': 'c1210485b2424d48804aad5d39c61b8f',
'name': sg_name,
'port_range_min': 22
}],
'id': 'eeee'}})
- quantumclient.Client.delete_security_group_rule('bbbb').AndReturn(None)
- quantumclient.Client.delete_security_group('eeee').AndReturn(None)
+ neutronclient.Client.delete_security_group_rule('bbbb').AndReturn(None)
+ neutronclient.Client.delete_security_group('eeee').AndReturn(None)
def mock_router_for_vpc(self):
- quantumclient.Client.list_routers(name=self.vpc_name).AndReturn({
+ neutronclient.Client.list_routers(name=self.vpc_name).AndReturn({
"routers": [{
"status": "ACTIVE",
"external_gateway_info": {
def mock_delete_network(self):
self.mock_router_for_vpc()
- quantumclient.Client.delete_router('bbbb').AndReturn(None)
- quantumclient.Client.delete_network('aaaa').AndReturn(None)
+ neutronclient.Client.delete_router('bbbb').AndReturn(None)
+ neutronclient.Client.delete_network('aaaa').AndReturn(None)
def mock_delete_subnet(self):
self.mock_router_for_vpc()
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
u'bbbb',
{'subnet_id': 'cccc'}).AndReturn(None)
- quantumclient.Client.delete_subnet('cccc').AndReturn(None)
+ neutronclient.Client.delete_subnet('cccc').AndReturn(None)
def mock_create_route_table(self):
self.rt_name = utils.PhysName('test_stack', 'the_route_table')
- quantumclient.Client.create_router({
+ neutronclient.Client.create_router({
'router': {'name': self.rt_name}}).AndReturn({
'router': {
'status': 'BUILD',
'id': 'ffff'
}
})
- quantumclient.Client.show_router('ffff').AndReturn({
+ neutronclient.Client.show_router('ffff').AndReturn({
'router': {
'status': 'BUILD',
'name': self.rt_name,
'id': 'ffff'
}
})
- quantumclient.Client.show_router('ffff').AndReturn({
+ neutronclient.Client.show_router('ffff').AndReturn({
'router': {
'status': 'ACTIVE',
'name': self.rt_name,
}
})
self.mock_router_for_vpc()
- quantumclient.Client.add_gateway_router(
+ neutronclient.Client.add_gateway_router(
'ffff', {'network_id': 'zzzz'}).AndReturn(None)
def mock_create_association(self):
self.mock_show_subnet()
self.mock_router_for_vpc()
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
'bbbb',
{'subnet_id': u'cccc'}).AndReturn(None)
- quantumclient.Client.add_interface_router(
+ neutronclient.Client.add_interface_router(
u'ffff',
{'subnet_id': 'cccc'}).AndReturn(None)
def mock_delete_association(self):
self.mock_show_subnet()
self.mock_router_for_vpc()
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
'ffff',
{'subnet_id': u'cccc'}).AndReturn(None)
- quantumclient.Client.add_interface_router(
+ neutronclient.Client.add_interface_router(
u'bbbb',
{'subnet_id': 'cccc'}).AndReturn(None)
def mock_delete_route_table(self):
- quantumclient.Client.delete_router('ffff').AndReturn(None)
- quantumclient.Client.remove_gateway_router('ffff').AndReturn(None)
+ neutronclient.Client.delete_router('ffff').AndReturn(None)
+ neutronclient.Client.remove_gateway_router('ffff').AndReturn(None)
def assertResourceState(self, resource, ref_id):
self.assertEqual(None, resource.validate())
# mock delete subnet which is already deleted
self.mock_router_for_vpc()
- quantumclient.Client.remove_interface_router(
+ neutronclient.Client.remove_interface_router(
u'bbbb',
{'subnet_id': 'cccc'}).AndRaise(
- QuantumClientException(status_code=404))
- quantumclient.Client.delete_subnet('cccc').AndRaise(
- QuantumClientException(status_code=404))
+ NeutronClientException(status_code=404))
+ neutronclient.Client.delete_subnet('cccc').AndRaise(
+ NeutronClientException(status_code=404))
self.m.ReplayAll()
stack = self.create_stack(self.test_template)
if security_groups:
port['security_groups'] = security_groups
- quantumclient.Client.create_port({'port': port}).AndReturn({
+ neutronclient.Client.create_port({'port': port}).AndReturn({
'port': {
'admin_state_up': True,
'device_id': '',
})
def mock_delete_network_interface(self):
- quantumclient.Client.delete_port('dddd').AndReturn(None)
+ neutronclient.Client.delete_port('dddd').AndReturn(None)
def test_network_interface(self):
self.mock_keystone()
'''
def mock_create_internet_gateway(self):
- quantumclient.Client.list_networks(
+ neutronclient.Client.list_networks(
**{'router:external': True}).AndReturn({'networks': [{
'status': 'ACTIVE',
'subnets': [],
}]})
def mock_create_gateway_attachment(self):
- quantumclient.Client.add_gateway_router(
+ neutronclient.Client.add_gateway_router(
'ffff', {'network_id': 'eeee'}).AndReturn(None)
def mock_delete_gateway_attachment(self):
- quantumclient.Client.remove_gateway_router('ffff').AndReturn(None)
+ neutronclient.Client.remove_gateway_router('ffff').AndReturn(None)
def test_internet_gateway(self):
self.mock_keystone()
WebOb==1.2.3
python-keystoneclient>=0.2.1
python-swiftclient>=1.2
-python-quantumclient>=2.2.0
+python-neutronclient>=2.2.3,<3
python-ceilometerclient>=1.0.1
python-cinderclient>=1.0.4
PyYAML>=3.1.0