fix InstanceInfo.HumanId
The module no longer has a "root" component, and use the normalizeModulePath function for consistency
This commit is contained in:
parent
b8df11bc33
commit
d0693d0db5
|
@ -145,18 +145,11 @@ func NewInstanceInfo(addr addrs.AbsResource) *InstanceInfo {
|
||||||
|
|
||||||
// HumanId is a unique Id that is human-friendly and useful for UI elements.
|
// HumanId is a unique Id that is human-friendly and useful for UI elements.
|
||||||
func (i *InstanceInfo) HumanId() string {
|
func (i *InstanceInfo) HumanId() string {
|
||||||
if i == nil {
|
p := normalizeModulePath(i.ModulePath)
|
||||||
return "<nil>"
|
if p.IsRoot() {
|
||||||
}
|
|
||||||
|
|
||||||
if len(i.ModulePath) <= 1 {
|
|
||||||
return i.Id
|
return i.Id
|
||||||
}
|
}
|
||||||
|
return fmt.Sprintf("%s.%s", p.String(), i.Id)
|
||||||
return fmt.Sprintf(
|
|
||||||
"module.%s.%s",
|
|
||||||
strings.Join(i.ModulePath[1:], "."),
|
|
||||||
i.Id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResourceAddress returns the address of the resource that the receiver is describing.
|
// ResourceAddress returns the address of the resource that the receiver is describing.
|
||||||
|
|
Loading…
Reference in New Issue