allow region to also be interpolated, like datacenter.

This commit is contained in:
Kate Taggart 2017-03-29 16:31:23 -07:00 committed by Alex Dadgar
parent 9fa97c38a0
commit 277d5ddb36

View file

@ -78,10 +78,11 @@ const (
// The node values that can be interpreted. // The node values that can be interpreted.
const ( const (
nodeIdKey = "node.unique.id" nodeIdKey = "node.unique.id"
nodeDcKey = "node.datacenter" nodeDcKey = "node.datacenter"
nodeNameKey = "node.unique.name" nodeRegionKey = "node.region"
nodeClassKey = "node.class" nodeNameKey = "node.unique.name"
nodeClassKey = "node.class"
// Prefixes used for lookups. // Prefixes used for lookups.
nodeAttributePrefix = "attr." nodeAttributePrefix = "attr."
@ -241,6 +242,7 @@ func (t *TaskEnvironment) Build() *TaskEnvironment {
// Set up the node values. // Set up the node values.
t.NodeValues[nodeIdKey] = t.Node.ID t.NodeValues[nodeIdKey] = t.Node.ID
t.NodeValues[nodeDcKey] = t.Node.Datacenter t.NodeValues[nodeDcKey] = t.Node.Datacenter
t.NodeValues[nodeRegionKey] = t.Node.Region
t.NodeValues[nodeNameKey] = t.Node.Name t.NodeValues[nodeNameKey] = t.Node.Name
t.NodeValues[nodeClassKey] = t.Node.NodeClass t.NodeValues[nodeClassKey] = t.Node.NodeClass