1
1
mirror of https://github.com/adammck/terraform-inventory synced 2024-11-22 15:52:01 +01:00

Fix tags for Joyent Triton (#76)

This commit is contained in:
Yonatan Koren 2017-09-08 11:40:08 -04:00 committed by Adam Mckaig
parent 3dd8834717
commit 3093ecd497
2 changed files with 10 additions and 0 deletions

@ -324,6 +324,7 @@ const expectedListOutput = `
"role_rrrrrrrr": ["10.20.30.40"],
"role_web": ["10.0.0.1"],
"role_test": ["10.0.0.10"],
"webserver": ["192.168.0.3"],
"staging": ["192.168.0.3"],
"status_superserver": ["10.120.0.226"],

@ -156,6 +156,15 @@ func (r Resource) Tags() map[string]string {
t[vv] = ""
}
}
case "triton_machine":
for k, v := range r.Attributes() {
parts := strings.SplitN(k, ".", 2)
if len(parts) == 2 && parts[0] == "tags" && parts[1] != "%" {
kk := strings.ToLower(parts[1])
vv := strings.ToLower(v)
t[kk] = vv
}
}
}
return t
}