Stop server

def stop_webserver(server):
    """
    Stop server
    """
    #TODO - distinguish between a warning and a error on apache
    if server == 'apache2':
        with settings(warn_only=True):
            if env.verbosity:
                print env.host,"STOPPING apache2"
            a = sudo("/etc/init.d/apache2 stop")
            if env.verbosity:
                print '',a
    elif server == 'gunicorn':
        with settings(warn_only=True):
            if env.verbosity:
                print env.host,"STOPPING","%s-%s"% (server,env.project_name)
            a = sudo("stop %s-%s"% (server,env.project_name))
            if env.verbosity and a.strip():
                print '',a
    return True