domain calculated using the host
This commit is contained in:
parent
97d5fc1c05
commit
cfdcc76a1e
|
@ -47,7 +47,7 @@ public class LegacyISPublisher implements Publisher{
|
|||
hostingNode = cpb.create();
|
||||
else {
|
||||
hostingNode = (HostingNode) resourcesCache.get(id);
|
||||
cpb.update(hostingNode, false);
|
||||
cpb.update(hostingNode);
|
||||
}
|
||||
|
||||
for (String context: contexts)
|
||||
|
@ -126,7 +126,7 @@ public class LegacyISPublisher implements Publisher{
|
|||
hostingNode = cpb.create();
|
||||
else {
|
||||
hostingNode = (HostingNode) resourcesCache.get(id);
|
||||
cpb.update(hostingNode, false);
|
||||
cpb.update(hostingNode);
|
||||
}
|
||||
|
||||
for (String context: contexts)
|
||||
|
@ -260,7 +260,7 @@ public class LegacyISPublisher implements Publisher{
|
|||
String id = container.id();
|
||||
|
||||
hostingNode = (HostingNode) resourcesCache.get(id);
|
||||
cpb.update(hostingNode, false);
|
||||
cpb.update(hostingNode);
|
||||
|
||||
resourcesCache.put(id, hostingNode);
|
||||
}
|
||||
|
|
|
@ -53,8 +53,6 @@ public class ContainerProfileBuilder {
|
|||
|
||||
node.setId(context.id());
|
||||
|
||||
addSiteTo(node);
|
||||
|
||||
String ip = "not resolved";
|
||||
try {
|
||||
ip = InetAddress.getLocalHost().getHostAddress();
|
||||
|
@ -73,7 +71,7 @@ public class ContainerProfileBuilder {
|
|||
node.profile().description().newArchitecture().platformType(System.getProperty("os.arch")).smpSize(0)
|
||||
.smtSize(0);
|
||||
|
||||
node.profile().newSite().domain(cfg.site().getCountry()).country(cfg.site().getCountry()).location(cfg.site().getLocation()).latitude("1").longitude("1");
|
||||
node.profile().newSite().domain(domainIn(cfg.hostname())).country(cfg.site().getCountry()).location(cfg.site().getLocation()).latitude("1").longitude("1");
|
||||
|
||||
ArrayList<HashMap<String, String>> info = cpuInfo();
|
||||
|
||||
|
@ -88,7 +86,7 @@ public class ContainerProfileBuilder {
|
|||
|
||||
addVariablesTo(node);
|
||||
|
||||
update(node,false);
|
||||
update(node);
|
||||
|
||||
node.profile().description().type(GHNType.Static);
|
||||
// String type = (String) context.getProperty(GHNContext.GHN_TYPE, false);
|
||||
|
@ -201,21 +199,7 @@ public class ContainerProfileBuilder {
|
|||
return free;
|
||||
}
|
||||
|
||||
public void update(HostingNode node,boolean onLoad) {
|
||||
|
||||
ContainerConfiguration cfg = context.configuration();
|
||||
|
||||
if (onLoad) {
|
||||
|
||||
log.info("updating ghn profile");
|
||||
|
||||
node.profile().description().activationTime(Calendar.getInstance()).name(cfg.hostname() + ":" + cfg.port());
|
||||
|
||||
addVariablesTo(node);
|
||||
|
||||
addSiteTo(node);
|
||||
|
||||
}
|
||||
public void update(HostingNode node) {
|
||||
|
||||
node.profile().description().status(context.lifecycle().state().remoteForm());
|
||||
|
||||
|
@ -239,13 +223,7 @@ public class ContainerProfileBuilder {
|
|||
|
||||
}
|
||||
|
||||
private void addSiteTo(HostingNode node) {
|
||||
|
||||
ContainerConfiguration cfg = context.configuration();
|
||||
|
||||
node.profile().newSite().country(cfg.site().getCountry()).location(cfg.site().getLocation())
|
||||
.latitude("unknown").longitude("unknown").domain(domainIn(cfg.hostname()));
|
||||
}
|
||||
|
||||
private void addVariablesTo(HostingNode node) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue