mirror of https://github.com/Icinga/icinga2.git
Move CompatUtility::GetHostAlias into DB IDO host object method
This is the only place where this mapping is used.
This commit is contained in:
parent
ab1a2bffcd
commit
70af1a3545
|
@ -47,8 +47,16 @@ Dictionary::Ptr HostDbObject::GetConfigFields() const
|
|||
Dictionary::Ptr fields = new Dictionary();
|
||||
Host::Ptr host = static_pointer_cast<Host>(GetObject());
|
||||
|
||||
fields->Set("alias", CompatUtility::GetHostAlias(host));
|
||||
fields->Set("display_name", host->GetDisplayName());
|
||||
/* Compatibility fallback. */
|
||||
String displayName = host->GetDisplayName();
|
||||
|
||||
if (!displayName.IsEmpty()) {
|
||||
fields->Set("alias", displayName);
|
||||
} else {
|
||||
fields->Set("alias", host->GetName());
|
||||
}
|
||||
|
||||
fields->Set("display_name", displayName);
|
||||
fields->Set("address", host->GetAddress());
|
||||
fields->Set("address6", host->GetAddress6());
|
||||
|
||||
|
|
|
@ -96,14 +96,6 @@ String CompatUtility::GetHostStateString(const Host::Ptr& host)
|
|||
return Host::StateToString(host->GetState());
|
||||
}
|
||||
|
||||
String CompatUtility::GetHostAlias(const Host::Ptr& host)
|
||||
{
|
||||
if (!host->GetDisplayName().IsEmpty())
|
||||
return host->GetName();
|
||||
else
|
||||
return host->GetDisplayName();
|
||||
}
|
||||
|
||||
int CompatUtility::GetHostNotifyOnDown(const Host::Ptr& host)
|
||||
{
|
||||
unsigned long notification_state_filter = GetCheckableNotificationStateFilter(host);
|
||||
|
|
|
@ -46,7 +46,6 @@ public:
|
|||
/* host */
|
||||
static int GetHostCurrentState(const Host::Ptr& host);
|
||||
static String GetHostStateString(const Host::Ptr& host);
|
||||
static String GetHostAlias(const Host::Ptr& host);
|
||||
static int GetHostNotifyOnDown(const Host::Ptr& host);
|
||||
static int GetHostNotifyOnUnreachable(const Host::Ptr& host);
|
||||
|
||||
|
|
Loading…
Reference in New Issue