KickstartHelper: get has no default value support

This commit is contained in:
Thomas Gelf 2016-03-31 18:17:42 +02:00
parent 651cb4570e
commit 9ae6f5539a
1 changed files with 15 additions and 3 deletions

View File

@ -229,10 +229,17 @@ class KickstartHelper
);
}
$ep = $this->deploymentEndpoint;
$epHost = $ep->get('host');
if (!$epHost) {
$epHost = $ep->object_name;
}
try {
$this->switchToDeploymentApi()->getStatus();
} catch (Exception $e) {
$ep = $this->deploymentEndpoint;
throw new ConfigurationError(
'I was unable to re-establish a connection to the Endpoint "%s" (%s:%d).'
. ' When reconnecting to the configured Endpoint (%s:%d) I get an error: %s'
@ -240,7 +247,7 @@ class KickstartHelper
$master,
$this->getHost(),
$this->getPort(),
$ep->get('host', $ep->object_name),
$epHost,
$ep->get('port'),
$e->getMessage()
);
@ -303,8 +310,13 @@ class KickstartHelper
unset($this->api);
$ep = $this->deploymentEndpoint;
$epHost = $ep->get('host');
if (!$epHost) {
$epHost = $ep->object_name;
}
$client = new RestApiClient(
$ep->get('host', $ep->object_name),
$epHost,
$ep->get('port')
);