Changed plugin name
This commit is contained in:
parent
26812f9ab9
commit
010260b9a0
3
.gitignore
vendored
3
.gitignore
vendored
@ -33,3 +33,6 @@ nosetests.xml
|
|||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
.project
|
.project
|
||||||
.pydevproject
|
.pydevproject
|
||||||
|
|
||||||
|
# virtualenv
|
||||||
|
.venv
|
||||||
|
@ -23,7 +23,60 @@ from quantum import quantum_plugin_base_v2
|
|||||||
from quantum.db import db_base_plugin_v2
|
from quantum.db import db_base_plugin_v2
|
||||||
|
|
||||||
|
|
||||||
class QuarkEmptyPlugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
|
class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
|
||||||
|
|
||||||
|
|
||||||
|
def _gen_uuid(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _make_network_dict(self, network, fields=None):
|
||||||
|
res = {'id': network.get('id'),
|
||||||
|
'name': network.get('name'),
|
||||||
|
'tenant_id': network.get('tenant_id'),
|
||||||
|
'admin_state_up': network.get('admin_state_up'),
|
||||||
|
'status': network.get('status'),
|
||||||
|
'shared': network.get('shared'),
|
||||||
|
'subnets': [subnet.get('id')
|
||||||
|
for subnet in network.get('subnets')]}
|
||||||
|
return res
|
||||||
|
|
||||||
|
def _make_subnet_dict(self, subnet, fields=None):
|
||||||
|
res = {'id': subnet.get('id'),
|
||||||
|
'name': subnet.get('name'),
|
||||||
|
'tenant_id': subnet.get('tenant_id'),
|
||||||
|
'network_id': subnet.get('network_id'),
|
||||||
|
'ip_version': subnet.get('ip_version'),
|
||||||
|
'cidr': subnet.get('cidr'),
|
||||||
|
'allocation_pools': [{'start': pool.get('first_ip'),
|
||||||
|
'end': pool.get('last_ip')}
|
||||||
|
for pool in subnet.get('allocation_pools')],
|
||||||
|
'gateway_ip': subnet.get('gateway_ip'),
|
||||||
|
'enable_dhcp': subnet.get('enable_dhcp'),
|
||||||
|
'dns_nameservers': [dns.get('address')
|
||||||
|
for dns in subnet.get('dns_nameservers')],
|
||||||
|
'host_routes': [{'destination': route.get('destination'),
|
||||||
|
'nexthop': route.get('nexthop')}
|
||||||
|
for route in subnet.get('routes')],
|
||||||
|
'shared': subnet.get('shared')
|
||||||
|
}
|
||||||
|
if subnet.get('gateway_ip'):
|
||||||
|
res['gateway_ip'] = subnet.get('gateway_ip')
|
||||||
|
return res
|
||||||
|
|
||||||
|
def _make_port_dict(self, port, fields=None):
|
||||||
|
res = {"id": port.get("id"),
|
||||||
|
'name': port.get('name'),
|
||||||
|
"network_id": port.get("network_id"),
|
||||||
|
'tenant_id': port.get('tenant_id'),
|
||||||
|
"mac_address": port.get("mac_address"),
|
||||||
|
"admin_state_up": port.get("admin_state_up"),
|
||||||
|
"status": port.get("status"),
|
||||||
|
"fixed_ips": [{'subnet_id': ip.get("subnet_id"),
|
||||||
|
'ip_address': ip.get("ip_address")}
|
||||||
|
for ip in port.get("fixed_ips")],
|
||||||
|
"device_id": port.get("device_id"),
|
||||||
|
"device_owner": port.get("device_owner")}
|
||||||
|
return res
|
||||||
|
|
||||||
def create_subnet(self, context, subnet):
|
def create_subnet(self, context, subnet):
|
||||||
"""
|
"""
|
||||||
@ -34,6 +87,8 @@ class QuarkEmptyPlugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
|
|||||||
as listed in the RESOURCE_ATTRIBUTE_MAP object in
|
as listed in the RESOURCE_ATTRIBUTE_MAP object in
|
||||||
quantum/api/v2/attributes.py. All keys will be populated.
|
quantum/api/v2/attributes.py. All keys will be populated.
|
||||||
"""
|
"""
|
||||||
|
subnet = {'id' : _gen_uuid()}
|
||||||
|
return _make_subnet_dict(subnet)
|
||||||
# need to return a dict much like the form from
|
# need to return a dict much like the form from
|
||||||
# db_base_plugin_v2._make_subnet_dict(subnet)
|
# db_base_plugin_v2._make_subnet_dict(subnet)
|
||||||
# we just need to pass it a jank subnet
|
# we just need to pass it a jank subnet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user