mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed "create_attach_volumes" salt-cloud action for GCP
Fixes #44088 - "create_attach_volumes" salt-cloud works with mandatory and default arguments as mentioned in docstring of the function.
This commit is contained in:
parent
d9530e3c52
commit
3eefd334c5
1 changed files with 6 additions and 5 deletions
|
@ -2400,9 +2400,10 @@ def create_attach_volumes(name, kwargs, call=None):
|
|||
'-a or --action.'
|
||||
)
|
||||
|
||||
volumes = kwargs['volumes']
|
||||
volumes = literal_eval(kwargs['volumes'])
|
||||
node = kwargs['node']
|
||||
node_data = _expand_node(node)
|
||||
conn = get_conn()
|
||||
node_data = _expand_node(conn.ex_get_node(node))
|
||||
letter = ord('a') - 1
|
||||
|
||||
for idx, volume in enumerate(volumes):
|
||||
|
@ -2412,9 +2413,9 @@ def create_attach_volumes(name, kwargs, call=None):
|
|||
'disk_name': volume_name,
|
||||
'location': node_data['extra']['zone']['name'],
|
||||
'size': volume['size'],
|
||||
'type': volume['type'],
|
||||
'image': volume['image'],
|
||||
'snapshot': volume['snapshot']
|
||||
'type': volume.get('type', 'pd-standard'),
|
||||
'image': volume.get('image', None),
|
||||
'snapshot': volume.get('snapshot', None)
|
||||
}
|
||||
|
||||
create_disk(volume_dict, 'function')
|
||||
|
|
Loading…
Add table
Reference in a new issue