def enable(site): """ Creates symlink from sites-available to sites-enabled """ available = "/etc/nginx/sites-available/{site}".format(site=site) enabled = "/etc/nginx/sites-enabled/{site}".format(site=site) command = "ln -s {available} {enabled}".format( available=available, enabled=enabled) system.system_command(command, sudo)
def disable(site): """ Removes symlink from sites-enabled """ enabled = "/etc/nginx/sites-enabled/{site}".format(site=site) command = "rm {enabled}".format(enabled=enabled) system.system_command(command, sudo)
def sites(): """Display nginx enabled sites""" command = 'ls -la /etc/nginx/sites-enabled' system.system_command(command, sudo)
def set(key, value): """ Set cache value stored @ key """ command = "redis-cli SET {key} {value}".format(key=key, value=value) system.system_command(command, sudo)
def get(key): """ Get cache value stored @ key """ command = "redis-cli GET {key}".format(key=key) system.system_command(command, sudo)
def flush(): """ Flushes caches """ command = 'redis-cli FLUSHALL' system.system_command(command, sudo)