Skip to content

Commit 0dbd27d

Browse files
jouvinAquilon main user
authored and
Aquilon main user
committed
Export the hub name as sysloc/region in the object plenary
- Contributes to quattor#104 Change-Id: I061147728c376e722b1ffd67665921416e1291d8
1 parent 8706a06 commit 0dbd27d

File tree

1 file changed

+8
-6
lines changed
  • lib/aquilon/worker/templates

1 file changed

+8
-6
lines changed

lib/aquilon/worker/templates/base.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -629,12 +629,16 @@ def transaction(self, verbose=False):
629629

630630

631631
def add_location_info(lines, dblocation, prefix="", use_rack_fullname=False):
632-
# FIXME: sort out hub/region
633-
for parent_type in ["continent", "country", "city", "campus", "building",
634-
"bunker"]:
632+
for parent_type in ["hub", "continent", "country", "city", "campus", "building",
633+
"room", "bunker"]:
635634
dbparent = getattr(dblocation, parent_type)
636635
if dbparent:
637-
pan_assign(lines, prefix + "sysloc/" + parent_type, dbparent.name)
636+
# Hub is an exception where the associated sysloc property has a different name
637+
if parent_type == "hub":
638+
sysloc_property = "region"
639+
else:
640+
sysloc_property = parent_type
641+
pan_assign(lines, prefix + "sysloc/" + sysloc_property, dbparent.name)
638642

639643
if dblocation.rack:
640644
# If use_rack_fullname is True, use the rack_fullname instead of the generated rack name
@@ -646,5 +650,3 @@ def add_location_info(lines, dblocation, prefix="", use_rack_fullname=False):
646650
pan_assign(lines, prefix + "rack/row", dblocation.rack_row)
647651
if dblocation.rack_column:
648652
pan_assign(lines, prefix + "rack/column", dblocation.rack_column)
649-
if dblocation.room:
650-
pan_assign(lines, prefix + "sysloc/room", dblocation.room.name)

0 commit comments

Comments
 (0)