mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
send a disable message to disable puppet
This commit is contained in:
parent
c73bf38927
commit
33f3d68489
@ -222,7 +222,7 @@ def enable():
|
||||
return False
|
||||
|
||||
|
||||
def disable():
|
||||
def disable(message=None):
|
||||
'''
|
||||
.. versionadded:: 2014.7.0
|
||||
|
||||
@ -244,7 +244,8 @@ def disable():
|
||||
with salt.utils.fopen(puppet.disabled_lockfile, 'w') as lockfile:
|
||||
try:
|
||||
# Puppet chokes when no valid json is found
|
||||
lockfile.write('{}')
|
||||
str = "{\"disabled_message\":\"%s\"}" % message if message is not None else '{}'
|
||||
lockfile.write(str)
|
||||
lockfile.close()
|
||||
return True
|
||||
except (IOError, OSError) as exc:
|
||||
|
Loading…
Reference in New Issue
Block a user