From bc863fd777b981f142a28edcc44f183110df3a00 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 13761a813..34c2b4808 100755 --- a/lib/aquilon/worker/templates/machine.py +++ b/lib/aquilon/worker/templates/machine.py @@ -56,7 +56,7 @@ def get_rack_name(cls, dbmachine): @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, cls.get_rack_name(dbmachine), dbmachine.label) def __init__(self, dbobj, **kwargs):