[Nostromo] Allow to 'sudo' remote commands

This commit is contained in:
Andrés Montañez
2017-01-02 20:35:03 -03:00
parent 90f122f0ad
commit 83551bd7b8
2 changed files with 112 additions and 1 deletions
+7 -1
View File
@@ -392,10 +392,16 @@ class Runtime
public function runRemoteCommand($cmd, $jail = true, $timeout = 120)
{
$user = $this->getEnvironmentConfig('user');
$sudo = $this->getEnvironmentConfig('sudo', false);
$host = $this->getWorkingHost();
$sshConfig = $this->getSSHConfig();
$cmdDelegate = $cmd;
if ($sudo === true) {
$cmdDelegate = sprintf('sudo %s', $cmd);
} else {
$cmdDelegate = $cmd;
}
if ($jail) {
$hostPath = rtrim($this->getEnvironmentConfig('host_path'), '/');
if ($this->getReleaseId()) {