mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
[lxd]: fix container_create not creating devices other than of type disk
This commit is contained in:
parent
21bb7bdc9e
commit
ec3b208d76
2 changed files with 6 additions and 1 deletions
1
changelog/63996.fixed.md
Normal file
1
changelog/63996.fixed.md
Normal file
|
@ -0,0 +1 @@
|
|||
[lxd] Fixed a bug in `container_create` which prevented devices which are not of type `disk` to be correctly created and added to the container when passed via the `devices` parameter.
|
|
@ -688,7 +688,11 @@ def container_create(
|
|||
# Add devices if not wait and devices have been given.
|
||||
if devices:
|
||||
for dn, dargs in devices.items():
|
||||
container_device_add(name, dn, **dargs)
|
||||
if "type" in dargs:
|
||||
# extract 'type' so it won't be overwritten
|
||||
container_device_add(name, dn, device_type=dargs["type"], **dargs)
|
||||
else:
|
||||
container_device_add(name, dn, **dargs)
|
||||
|
||||
if _raw:
|
||||
return container
|
||||
|
|
Loading…
Add table
Reference in a new issue