From 33c21f4fbeeefd37aed5de5f538074ba1a8f0ffb Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Fri, 13 Jul 2018 10:01:38 +0200 Subject: [PATCH] Change site and machine namespace to use continent name - Used to be hub fullname previously which is not exported to the object plenary, making impossible to locate the site template (not included by default in the object plenary) - Hosts must be rebuilt to use the new namespace Fixes https://github.com/quattor/aquilon/issues/104 Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2 --- lib/aquilon/worker/templates/city.py | 2 +- lib/aquilon/worker/templates/machine.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aquilon/worker/templates/city.py b/lib/aquilon/worker/templates/city.py index ed97b618c..837ff3c46 100644 --- a/lib/aquilon/worker/templates/city.py +++ b/lib/aquilon/worker/templates/city.py @@ -30,7 +30,7 @@ class PlenaryCity(Plenary): @classmethod def template_name(cls, dbcity): - return "%s/%s/%s/config" % (cls.prefix, dbcity.hub.fullname.lower(), + return "%s/%s/%s/config" % (cls.prefix, dbcity.continent.name, dbcity.name) def body(self, lines): diff --git a/lib/aquilon/worker/templates/machine.py b/lib/aquilon/worker/templates/machine.py index e10955ec2..21ea2facd 100755 --- a/lib/aquilon/worker/templates/machine.py +++ b/lib/aquilon/worker/templates/machine.py @@ -40,7 +40,7 @@ class PlenaryMachineInfo(StructurePlenary): @classmethod def template_name(cls, dbmachine): loc = dbmachine.location - return "%s/%s/%s/%s/%s" % (cls.prefix, loc.hub.fullname.lower(), + return "%s/%s/%s/%s/%s" % (cls.prefix, loc.continent.name, loc.building, loc.rack, dbmachine.label) def __init__(self, dbobj, **kwargs):