Skip to content

Commit

Permalink
Export the OS name in the host data plenary
Browse files Browse the repository at this point in the history
There's no reason not to...

Change-Id: I2f7e7e4ef3b9051272c981a23958f0f2ec8391e7
Reviewed-by: Dave Reeve <[email protected]>
  • Loading branch information
gombasg committed Sep 13, 2016
1 parent aa35d4f commit 3b82d80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/aquilon/worker/templates/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ def body(self, lines):
path = hwplenary.template_name(dbhw_ent)
pan_assign(lines, "hardware", StructureTemplate(path))

lines.append("")
dbos = self.dbobj.operating_system
pan_assign(lines, "system/archetype/os", dbos.name)
pan_assign(lines, "system/archetype/model", dbos.version)

lines.append("")
for name in sorted(interfaces):
# This is ugly. We can't blindly escape, because that would affect
Expand Down Expand Up @@ -377,8 +382,8 @@ def body(self, lines):
{"metadata": PanValue("/metadata")}))
pan_include(lines, "archetype/base")

opsys = self.dbobj.operating_system
pan_include(lines, "os/%s/%s/config" % (opsys.name, opsys.version))
dbos = self.dbobj.operating_system
pan_include(lines, "os/%s/%s/config" % (dbos.name, dbos.version))

hw_features, iface_features = nonhost_features(dbstage, dbhw_ent)

Expand Down
6 changes: 5 additions & 1 deletion tests/broker/test_make_aquilon.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ def testverifycatunittest02(self):
command)
self.matchoutput(out, '"system/network/default_gateway" = "%s";' %
self.net["unknown0"].gateway, command)
self.matchoutput(out, '"system/advertise_status" = false', command)
self.matchoutput(out, '"system/advertise_status" = false;', command)
self.matchoutput(out, '"system/archetype/os" = "linux";', command)
self.matchoutput(out,
'"system/archetype/model" = "%s";' % self.linux_version_prev,
command)

command = "cat --hostname unittest02.one-nyp.ms.com"
out = self.commandtest(command.split(" "))
Expand Down

0 comments on commit 3b82d80

Please sign in to comment.