send a disable message to disable puppet

This commit is contained in:
nleib 2015-05-21 15:52:41 +03:00
parent c73bf38927
commit 33f3d68489

View File

@ -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: