Skip to content

Commit

Permalink
Export the hub name as sysloc/region in the object plenary
Browse files Browse the repository at this point in the history
- Contributes to #104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
  • Loading branch information
jouvin committed Aug 16, 2018
1 parent 2306b5e commit 584c978
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/aquilon/worker/templates/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,18 +629,20 @@ def transaction(self, verbose=False):


def add_location_info(lines, dblocation, prefix=""):
# FIXME: sort out hub/region
for parent_type in ["continent", "country", "city", "campus", "building",
"bunker"]:
for parent_type in ["hub", "continent", "country", "city", "campus", "building",
"room", "bunker"]:
dbparent = getattr(dblocation, parent_type)
if dbparent:
pan_assign(lines, prefix + "sysloc/" + parent_type, dbparent.name)
# Hub is an exception where the associated sysloc property has a different name
if parent_type == "hub":
sysloc_property = "region"
else:
sysloc_property = parent_type
pan_assign(lines, prefix + "sysloc/" + sysloc_property, dbparent.name)

if dblocation.rack:
pan_assign(lines, prefix + "rack/name", dblocation.rack.name)
if dblocation.rack_row:
pan_assign(lines, prefix + "rack/row", dblocation.rack_row)
if dblocation.rack_column:
pan_assign(lines, prefix + "rack/column", dblocation.rack_column)
if dblocation.room:
pan_assign(lines, prefix + "sysloc/room", dblocation.room.name)

0 comments on commit 584c978

Please sign in to comment.