quantum_network should not default network provider type to local

It should allow the Quantum service to decide based on its configuration.
reviewable/pr18780/r1
Darragh O'Reilly 11 years ago
parent a32f1cac8d
commit 986aebb284

@ -64,11 +64,11 @@ options:
- Name to be assigned to the nework - Name to be assigned to the nework
required: true required: true
default: None default: None
network_type: provider_network_type:
description: description:
- The type of the network to be created, gre, vlan, local. - The type of the network to be created, gre, vlan, local. Available types depend on the plugin. The Quantum service decides if not specified.
required: false required: false
default: local default: None
provider_physical_network: provider_physical_network:
description: description:
- The physical network which would realize the virtual network for flat and vlan networks. - The physical network which would realize the virtual network for flat and vlan networks.
@ -200,6 +200,11 @@ def _create_network(module, quantum):
if module.params['provider_network_type'] == 'gre': if module.params['provider_network_type'] == 'gre':
network.pop('provider:physical_network', None) network.pop('provider:physical_network', None)
if module.params['provider_network_type'] is None:
network.pop('provider:network_type', None)
network.pop('provider:physical_network', None)
network.pop('provider:segmentation_id', None)
try: try:
net = quantum.create_network({'network':network}) net = quantum.create_network({'network':network})
except Exception as e: except Exception as e:
@ -225,7 +230,7 @@ def main():
region_name = dict(default=None), region_name = dict(default=None),
name = dict(required=True), name = dict(required=True),
tenant_name = dict(default=None), tenant_name = dict(default=None),
provider_network_type = dict(default='local', choices=['local', 'vlan', 'flat', 'gre']), provider_network_type = dict(default=None, choices=['local', 'vlan', 'flat', 'gre']),
provider_physical_network = dict(default=None), provider_physical_network = dict(default=None),
provider_segmentation_id = dict(default=None), provider_segmentation_id = dict(default=None),
router_external = dict(default=False, type='bool'), router_external = dict(default=False, type='bool'),

Loading…
Cancel
Save