def enable(): '''Return a maintenance page (and 503 status) in response to all requests ''' authenticate() with fab.prefix("umask 0002"): fab.run("touch %(maintenance_file)s" % env)
def disable(): '''Remove maintenance page and respond to requests normally''' authenticate() fab.run("rm -f %(maintenance_file)s" % env)
def _write_alert(level, msg): authenticate() with fab.prefix("umask 0002"): with open(env['alert_file'], "w") as fout: fout.write(DELIM.join([level, msg]))
def clear(): '''clear all alert messages''' authenticate() fab.run("rm -f %(alert_file)s" % env)