mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
parent
aeb82f0829
commit
d38199f04f
@ -109,6 +109,10 @@ def 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__['docker.create_network'](
|
||||
name, driver=driver)
|
||||
@ -155,6 +159,11 @@ def 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__['docker.disconnect_container_from_network'](container, name)
|
||||
|
Loading…
Reference in New Issue
Block a user