From 3749978cccdf42caf926dde7fdfa1c15de5a5efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sun, 8 Jan 2017 01:33:14 -0300 Subject: [PATCH] [Nostromo] Rollback command, Mess Detector recommendation. --- src/Mage/Command/BuiltIn/Releases/RollbackCommand.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php b/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php index 4f5b212..8e7fb1c 100644 --- a/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php +++ b/src/Mage/Command/BuiltIn/Releases/RollbackCommand.php @@ -106,6 +106,7 @@ class RollbackCommand extends DeployCommand $availableInHosts = 0; foreach ($hosts as $host) { + $releases = []; $this->runtime->setWorkingHost($host); // Get List of Releases @@ -113,9 +114,7 @@ class RollbackCommand extends DeployCommand /** @var Process $process */ $process = $this->runtime->runRemoteCommand($cmdListReleases, false); - if (!$process->isSuccessful()) { - $releases = []; - } else { + if ($process->isSuccessful()) { $releases = explode(PHP_EOL, trim($process->getOutput())); rsort($releases); }