예제 #1
0
def sudo(command, shell=True, user=None, pty=False):
    """If the host is localhost, runs without requiring SSH."""
    require('hosts')
    if 'localhost' in env.hosts:
        command = 'sudo %s' % command
        return local(command, capture=False)
    else:
        return fabric_sudo(command, shell, user, pty)
예제 #2
0
def sudo(command, shell=True, user=None, pty=False):
    """If the host is localhost, runs without requiring SSH."""
    require('hosts')
    if 'localhost' in env.hosts:
        command = 'sudo %s' % command
        return local(command, capture=False)
    else:
        return fabric_sudo(command, shell, user, pty)
예제 #3
0
    def sudo(*args, **kwargs):
        if is_localhost(env.host_string):
            return nofabric.sudo(*args, **kwargs)

        else:
            return fabric_sudo(*args, **kwargs)
예제 #4
0
    def sudo(*args, **kwargs):
        if is_localhost(env.host_string):
            return nofabric.sudo(*args, **kwargs)

        else:
            return fabric_sudo(*args, **kwargs)
예제 #5
0
파일: fabutil2.py 프로젝트: amrik/fabutil
def sudo(command, **kwargs):
    return fabric_sudo(command, **kwargs)
예제 #6
0
def sudo(command, shell=True, pty=True, user=None):
    return fabric_sudo(command % (env), shell=shell, user=user, pty=pty)
예제 #7
0
 def sudo(self, command, **kwargs):
     if self.local_deployment:
         return self.local(self.fmt(command, **kwargs), use_sudo=True, capture=True, **kwargs)
     return fabric_sudo(self.fmt(command, **kwargs), **self._expects(kwargs, self.sudo_expect))