mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +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)
|
protected function renderBashParameters($parameters)
|
||||||
{
|
{
|
||||||
$maxKeyLength = max(array_map('strlen', array_keys($parameters)));
|
|
||||||
$parts = array();
|
$parts = array();
|
||||||
|
|
||||||
foreach ($parameters as $key => $value) {
|
foreach ($parameters as $key => $value) {
|
||||||
$parts[] = $this->renderBashParameter($key, $value, $maxKeyLength);
|
$parts[] = $this->renderBashParameter($key, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode("\n ", $parts);
|
return implode("\n", $parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function renderBashParameter($key, $value, $maxKeyLength = null)
|
protected function renderBashParameter($key, $value)
|
||||||
{
|
{
|
||||||
$ret = $key . '=';
|
$ret = $key . '=';
|
||||||
|
|
||||||
//if ($maxKeyLength !== null) {
|
// Cheating, this doesn't really help. We should ship the rendered config
|
||||||
// $ret .= str_repeat(' ', $maxKeyLength - strlen($key));
|
if (is_array($value) && count($value) === 1) {
|
||||||
//}
|
$value = array_shift($value);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$vals = array();
|
$vals = array();
|
||||||
foreach ($value as $val) {
|
foreach ($value as $val) {
|
||||||
$vals[] = $this->renderPowershellString($val);
|
$vals[] = $this->renderPowershellString($val);
|
||||||
}
|
}
|
||||||
$ret .= implode(', ', $vals);
|
$ret .= '(' . implode(' ', $vals) . ')';
|
||||||
} else {
|
} else {
|
||||||
$ret .= $this->renderPowershellString($value);
|
$ret .= $this->renderPowershellString($value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user