Modified template to support neutron configuration input

Change-Id: I3dc57f3cc413fc36763ff5f75d7dd11b84b3d322
This commit is contained in:
grace.yu 2015-02-06 15:11:01 -08:00
parent be06a81171
commit 51364fe942
3 changed files with 78 additions and 46 deletions

View File

@ -0,0 +1,2 @@
NAME = 'general_list'
FIELD_TYPE = list

View File

@ -6,46 +6,46 @@ METADATA = {
}, },
'service_credentials': { 'service_credentials': {
'_self': { '_self': {
'required_in_whole_config': True, 'required_in_whole_config': True,
'key_extensions': { 'key_extensions': {
'$service': ['image', 'compute', 'dashboard', 'identity', 'metering', 'rabbitmq', 'volume', 'mysql'] '$service': ['image', 'compute', 'dashboard', 'identity', 'metering', 'rabbitmq', 'volume', 'mysql']
}, },
'mapping_to': 'service_credentials' 'mapping_to': 'service_credentials'
}, },
'$service': { '$service': {
'_self': { '_self': {
'required_in_whole_config': True, 'required_in_whole_config': True,
'mapping_to': '$service' 'mapping_to': '$service'
}, },
'username': { 'username': {
'_self': { '_self': {
'is_required': True, 'is_required': True,
'field': 'username', 'field': 'username',
'mapping_to': 'username' 'mapping_to': 'username'
} }
}, },
'password': { 'password': {
'_self': { '_self': {
'is_required': True, 'is_required': True,
'field': 'password', 'field': 'password',
'mapping_to': 'password' 'mapping_to': 'password'
} }
} }
} }
}, },
'console_credentials': { 'console_credentials': {
'_self': {
'required_in_whole_config': True,
'key_extensions': {
'$console': ['admin', 'compute', 'dashboard', 'image', 'metering', 'network', 'object-store', 'volume']
},
'mapping_to': 'console_credentials'
},
'$console': {
'_self': { '_self': {
'required_in_whole_config': True, 'required_in_whole_config': True,
'mapping_to': '$console' 'key_extensions': {
}, '$console': ['admin', 'compute', 'dashboard', 'image', 'metering', 'network', 'object-store', 'volume']
},
'mapping_to': 'console_credentials'
},
'$console': {
'_self': {
'required_in_whole_config': True,
'mapping_to': '$console'
},
'username': { 'username': {
'_self': { '_self': {
'is_required': True, 'is_required': True,
@ -80,26 +80,50 @@ METADATA = {
'options': ['gre', 'vlan'], 'options': ['gre', 'vlan'],
'default_value': 'gre' 'default_value': 'gre'
} }
},
'network_vlan_ranges': {
'_self': {
'mapping_to': 'vlan_ranges',
'is_required': False,
'field': 'general_list',
'default_value': ['physnet1:2700:2999']
}
},
'bridge_mappings': {
'_self': {
'mapping_to': 'bridge_mappings',
'is_required': False,
'field': 'general_list',
'default_value': ['physnet1:br-eth1']
}
},
'tunnel_id_ranges': {
'_self': {
'mapping_to': 'tunnel_id_ranges',
'is_required': False,
'field': 'general_list',
'default_value': ['1:1000']
}
} }
} }
}, },
'network_mapping': { 'network_mapping': {
'_self': { '_self': {
'required_in_whole_config': True, 'required_in_whole_config': True,
'key_extensions': { 'key_extensions': {
'$interface_type': ['management', 'external', 'storage', 'tenant'] '$interface_type': ['management', 'external', 'storage', 'tenant']
} }
}, },
'$interface_type': { '$interface_type': {
'_self': { '_self': {
'required_in_whole_config': True, 'required_in_whole_config': True,
'field': 'anytype', 'field': 'anytype',
'autofill_callback': autofill_network_mapping, 'autofill_callback': autofill_network_mapping,
'mapping_to': '$interface_type' 'mapping_to': '$interface_type'
}, },
'interface': { 'interface': {
'_self': { '_self': {
'is_required': True, 'is_required': True,
'field': 'general', 'field': 'general',
} }
}, },

View File

@ -58,10 +58,16 @@
## Set Openstack neutron config ## Set Openstack neutron config
#set tenant_network_type = $getDictValue('neutron_config/openvswitch/tenant_network_type', 'gre') #set tenant_network_type = $getDictValue('neutron_config/openvswitch/tenant_network_type', 'gre')
#set enable_tunneling = True #set enable_tunneling = True
#set tunnel_id_ranges = ''
#set vlan_ranges = ''
#set bridge_mappings = '' #set bridge_mappings = ''
#if $tenant_network_type != 'gre'
#if $tenant_network_type == 'vlan'
#set enable_tunneling = False #set enable_tunneling = False
#set bridge_mappings = 'physnet1:br-eth1' #set bridge_mappings = ','.join($getDictValue('neutron_config/openvswitch/bridge_mappings', ['physnet1:br-eth1']))
#set vlan_ranges = ','.join($getDictValue('neutron_config/openvswitch/vlan_ranges', ['physnet1:2700:2999']))
#else
#set tunnel_id_ranges = ','.join($getDictValue('neutron_config/openvswitch/tunnel_id_ranges', ['1:1000']))
#end if #end if
## Utility functions definition ## Utility functions definition
@ -183,15 +189,15 @@
"ml2": { "ml2": {
"type_drivers": "$tenant_network_type", "type_drivers": "$tenant_network_type",
"tenant_network_types": "$tenant_network_type", "tenant_network_types": "$tenant_network_type",
"tunnel_id_ranges": "1:1000", "tunnel_id_ranges": "$tunnel_id_ranges",
"network_vlan_ranges": "physnet1:2700:2999", "network_vlan_ranges": "$vlan_ranges",
"enable_security_group": "True" "enable_security_group": "True"
}, },
"openvswitch": { "openvswitch": {
"tenant_network_type": "$tenant_network_type", "tenant_network_type": "$tenant_network_type",
"enable_tunneling": "$enable_tunneling", "enable_tunneling": "$enable_tunneling",
"tunnel_id_ranges": "1:1000", "tunnel_id_ranges": "$tunnel_id_ranges",
"network_vlan_ranges": "physnet1:2700:2999", "network_vlan_ranges": "$vlan_ranges",
"bridge_mappings": "$bridge_mappings", "bridge_mappings": "$bridge_mappings",
"bind_interface": "$network_worker_tenant_nic" "bind_interface": "$network_worker_tenant_nic"
}, },