_varnish_terminal_run() returns an array on success, where the array keys are the server ip and port of the terminal.

$result = _varnish_terminal_run('vcl.list');
print_r(array_keys($result));
Array
(
    [0] => 127.0.0.1:6082
)

Successful results are added to this array keyed by the terminal and command:

$ret[$terminal][$command] = $status;

Unsuccessful results are logged to watchdog and added to the results array:

$ret[] = FALSE;

PHP assigns these array keys numerically:

$result = _varnish_terminal_run('vcl.list');
print_r(array_keys($result));
Array
(
    [0] => 127.0.0.1:6082
    [1] => 0
)

This makes it more complex to identify which servers failed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

manarth’s picture

Status: Active » Needs review
FileSize
460 bytes

This patch simply provides the server ip and port in the results array (with the value set to FALSE to show the command failed).

fabsor’s picture

fabsor’s picture

Status: Needs review » Fixed

Setting status.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.