Skip to content

Commit ffb89af

Browse files
authored
Fixes acquia#1582: @executeInDrupalVm annotation not respected. (acquia#1585)
* Fixes acquia#1582: @executeInDrupalVm annotation not respected. * Adding debug information for Drupal VM inspector results.
1 parent e6f2fd7 commit ffb89af

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Robo/Commands/Blt/DoctorCommand.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Acquia\Blt\Robo\Commands\Blt;
44

55
use Acquia\Blt\Robo\BltTasks;
6+
use Robo\Contract\VerbosityThresholdInterface;
67
use Symfony\Component\Yaml\Yaml;
78

89
/**
@@ -17,6 +18,11 @@ class DoctorCommand extends BltTasks {
1718
*/
1819
public function doctor() {
1920

21+
$this->taskDrush()
22+
->drush('cc drush')
23+
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
24+
->run();
25+
2026
// Attempt to run BLT doctor inside of a VM.
2127
if ($this->getInspector()->isDrupalVmLocallyInitialized()
2228
&& $this->getInspector()->isDrupalVmBooted()

src/Robo/Inspector/Inspector.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,11 @@ public function isDrupalVmLocallyInitialized() {
238238
// rather than self, then Drupal VM is being used locally.
239239
$drush_local_alias = $this->getConfigValue('drush.aliases.local');
240240
$expected_vm_alias = $this->getConfigValue('project.machine_name') . '.local';
241+
$initialized = ($drush_local_alias == $expected_vm_alias) && file_exists($this->getConfigValue('repo.root') . '/box/config.yml');
242+
$statement = $initialized ? "is" : "is not";
243+
$this->logger->debug("Drupal VM $statement initialized.");
241244

242-
return $drush_local_alias == $expected_vm_alias && file_exists($this->getConfigValue('repo.root') . '/box/config.yml');
245+
return $initialized;
243246
}
244247

245248
/**
@@ -260,7 +263,11 @@ public function isDrupalVmBooted() {
260263
->run();
261264
$output = $result->getOutputData();
262265

263-
return strstr($output, "running");
266+
$booted = strstr($output, "running");
267+
$statement = $booted ? "is" : "is not";
268+
$this->logger->debug("Drupal VM $statement booted.");
269+
270+
return $booted;
264271
}
265272

266273
/**

0 commit comments

Comments
 (0)