Alias vm_['provider'] references to vm_['driver'] in cloud drivers

This commit is contained in:
rallytime 2015-06-17 15:42:23 -06:00
parent 10d58d72b6
commit ea31f530ba
11 changed files with 93 additions and 24 deletions

View File

@ -566,6 +566,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -573,7 +579,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -658,7 +664,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -303,6 +303,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -310,7 +316,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -459,7 +465,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -2100,6 +2100,11 @@ def create(vm_=None, call=None):
'You cannot create an instance with -a or -f.'
)
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -2107,12 +2112,12 @@ def create(vm_=None, call=None):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
salt.utils.cloud.cachedir_index_add(
vm_['name'], vm_['profile'], 'ec2', vm_['provider']
vm_['name'], vm_['profile'], 'ec2', vm_['driver']
)
key_filename = config.get_cloud_config_value(
@ -2306,7 +2311,7 @@ def create(vm_=None, call=None):
event_data = {
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
'instance_id': vm_['instance_id'],
}
if volumes:
@ -2942,7 +2947,12 @@ def list_nodes_full(location=None, call=None):
def _vm_provider_driver(vm_):
alias, driver = vm_['provider'].split(':')
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
alias, driver = vm_['driver'].split(':')
if alias not in __opts__['providers']:
return None

View File

@ -242,6 +242,12 @@ def create(vm_):
salt-cloud -p profile_name vm_name
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
key_filename = config.get_cloud_config_value(
'private_key', vm_, __opts__, search_global=False, default=None
)
@ -253,7 +259,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -312,7 +318,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -399,6 +399,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -406,7 +412,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -654,7 +660,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -543,6 +543,11 @@ def create(vm_):
vm_['key_filename'] = key_filename
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -550,7 +555,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -750,7 +755,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -284,6 +284,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -291,7 +297,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
)
@ -493,7 +499,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
)

View File

@ -270,6 +270,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -277,7 +283,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -456,7 +462,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -480,6 +480,12 @@ def create(vm_):
salt-cloud -p proxmox-ubuntu vmhostname
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
ret = {}
salt.utils.cloud.fire_event(
@ -489,7 +495,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -675,7 +681,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
)

View File

@ -638,6 +638,12 @@ def create(vm_):
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -645,7 +651,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -719,7 +725,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

View File

@ -204,6 +204,12 @@ def create(vm_):
'''
Create a single VM from a data dict
'''
# Since using "provider: <provider-engine>" is deprecated, alias provider
# to use driver: "driver: <provider-engine>"
if 'provider' in vm_:
vm_['driver'] = vm_.pop('provider')
salt.utils.cloud.fire_event(
'event',
'starting create',
@ -211,7 +217,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)
@ -296,7 +302,7 @@ def create(vm_):
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['provider'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)