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)
def sudo(*args, **kwargs): if is_localhost(env.host_string): return nofabric.sudo(*args, **kwargs) else: return fabric_sudo(*args, **kwargs)
def sudo(command, **kwargs): return fabric_sudo(command, **kwargs)
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))