mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #41977 from redmatter/fix-dockerng-network-ignores-test
Fix dockerng.network_* ignoring of tests=True
This commit is contained in:
commit
c15d0034fe
1 changed files with 10 additions and 0 deletions
|
@ -2273,6 +2273,11 @@ def network_present(name, driver=None, containers=None):
|
|||
ret['result'] = result
|
||||
|
||||
else:
|
||||
if __opts__['test']:
|
||||
ret['result'] = None
|
||||
ret['comment'] = ('The network \'{0}\' will be created'.format(name))
|
||||
return ret
|
||||
|
||||
try:
|
||||
ret['changes']['created'] = __salt__['dockerng.create_network'](
|
||||
name, driver=driver)
|
||||
|
@ -2332,6 +2337,11 @@ def network_absent(name, driver=None):
|
|||
ret['comment'] = 'Network \'{0}\' already absent'.format(name)
|
||||
return ret
|
||||
|
||||
if __opts__['test']:
|
||||
ret['result'] = None
|
||||
ret['comment'] = ('The network \'{0}\' will be removed'.format(name))
|
||||
return ret
|
||||
|
||||
for container in networks[0]['Containers']:
|
||||
try:
|
||||
ret['changes']['disconnected'] = __salt__['dockerng.disconnect_container_from_network'](container, name)
|
||||
|
|
Loading…
Add table
Reference in a new issue