Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
def disable():
    '''Remove maintenance page and respond to requests normally'''
    authenticate()
    fab.run("rm -f %(maintenance_file)s" % env)
Пример #4
0
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]))
Пример #5
0
def clear():
    '''clear all alert messages'''
    authenticate()
    fab.run("rm -f %(alert_file)s" % env)
Пример #6
0
def disable():
    '''Remove maintenance page and respond to requests normally'''
    authenticate()
    fab.run("rm -f %(maintenance_file)s" % env)
Пример #7
0
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]))
Пример #8
0
def clear():
    '''clear all alert messages'''
    authenticate()
    fab.run("rm -f %(alert_file)s" % env)