mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
AgentWizard: endpoints should be an array
refs #651 - but doesn't fix the issue
This commit is contained in:
parent
d5bf2a4b47
commit
c7d90481a4
@ -228,30 +228,30 @@ class AgentWizard
|
||||
}
|
||||
protected function renderBashParameters($parameters)
|
||||
{
|
||||
$maxKeyLength = max(array_map('strlen', array_keys($parameters)));
|
||||
$parts = array();
|
||||
|
||||
foreach ($parameters as $key => $value) {
|
||||
$parts[] = $this->renderBashParameter($key, $value, $maxKeyLength);
|
||||
$parts[] = $this->renderBashParameter($key, $value);
|
||||
}
|
||||
|
||||
return implode("\n", $parts);
|
||||
}
|
||||
|
||||
protected function renderBashParameter($key, $value, $maxKeyLength = null)
|
||||
protected function renderBashParameter($key, $value)
|
||||
{
|
||||
$ret = $key . '=';
|
||||
|
||||
//if ($maxKeyLength !== null) {
|
||||
// $ret .= str_repeat(' ', $maxKeyLength - strlen($key));
|
||||
//}
|
||||
// Cheating, this doesn't really help. We should ship the rendered config
|
||||
if (is_array($value) && count($value) === 1) {
|
||||
$value = array_shift($value);
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
$vals = array();
|
||||
foreach ($value as $val) {
|
||||
$vals[] = $this->renderPowershellString($val);
|
||||
}
|
||||
$ret .= implode(', ', $vals);
|
||||
$ret .= '(' . implode(' ', $vals) . ')';
|
||||
} else {
|
||||
$ret .= $this->renderPowershellString($value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user