Esempio n. 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)
Esempio n. 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)
Esempio n. 3
0
    def sudo(*args, **kwargs):
        if is_localhost(env.host_string):
            return nofabric.sudo(*args, **kwargs)

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

        else:
            return fabric_sudo(*args, **kwargs)
Esempio n. 5
0
def sudo(command, **kwargs):
    return fabric_sudo(command, **kwargs)
Esempio n. 6
0
def sudo(command, shell=True, pty=True, user=None):
    return fabric_sudo(command % (env), shell=shell, user=user, pty=pty)
 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))