mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Added safer .get method to vm_ 'networks' dictionary
This commit is contained in:
parent
feab016501
commit
63dfd1a23a
@ -107,6 +107,8 @@ VALID_RESPONSE_CODES = [
|
||||
http_client.NO_CONTENT
|
||||
]
|
||||
|
||||
DEFAULT_NETWORKS = ['Joyent-SDC-Public']
|
||||
|
||||
|
||||
# Only load in this module if the Joyent configurations are in place
|
||||
def __virtual__():
|
||||
@ -281,7 +283,7 @@ def create(vm_):
|
||||
salt.utils.cloud.check_name(vm_['name'], 'a-zA-Z0-9-.')
|
||||
kwargs = {
|
||||
'name': vm_['name'],
|
||||
'networks': vm_['networks'],
|
||||
'networks': vm_.get('networks', DEFAULT_NETWORKS),
|
||||
'image': get_image(vm_),
|
||||
'size': get_size(vm_),
|
||||
'location': vm_.get('location', DEFAULT_LOCATION)
|
||||
|
Loading…
Reference in New Issue
Block a user