Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export archetype/os as a dict in hostdata template #94

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions etc/aqd.conf.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ gzip_output = false
transparent_gzip = true
template_extension = .tpl
include_pan = True
# Define archetype/os as a dict (required by template library
# since 17.7.0). Used to be a string.
archetype_os_dict = False

[tool_timeout]
# If set to True, timeout will be set to 'default_value' for any tools run via subprocess
Expand Down
3 changes: 3 additions & 0 deletions etc/aqd.conf.noms
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ location_uri_validator = /bin/true
# The update_domain command expects to be able to read this value
# in raw mode and set the version variable itself.
pan_compiler = /usr/lib/panc.jar
# Define archetype/os as a dict (required by template library
# since 17.7.0). Used to be a string.
archetype_os_dict = True

###############################################################################

Expand Down
8 changes: 6 additions & 2 deletions lib/aquilon/worker/templates/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ def body(self, lines):

lines.append("")
dbos = self.dbobj.operating_system
pan_assign(lines, "system/archetype/os", dbos.name)
pan_assign(lines, "system/archetype/model", dbos.version)
if self.config.getboolean("panc", "archetype_os_dict"):
pan_assign(lines, "system/archetype/os/name", dbos.name)
pan_assign(lines, "system/archetype/os/version", dbos.version)
else:
pan_assign(lines, "system/archetype/os", dbos.name)
pan_assign(lines, "system/archetype/model", dbos.version)
pan_assign(lines, "system/archetype/os_lifecycle", dbos.lifecycle)

lines.append("")
Expand Down