zones: introduce Machine.FullName()
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -2,6 +2,7 @@ package zones
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -38,3 +39,17 @@ func (m *Machine) ID() int {
|
|||||||
|
|
||||||
return m.id
|
return m.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FullName returns the Name of the machine including domain name
|
||||||
|
func (m *Machine) FullName() string {
|
||||||
|
if domain := m.zone.zones.domain; domain != "" {
|
||||||
|
var s = []string{
|
||||||
|
m.Name,
|
||||||
|
domain,
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(s, ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
return m.Name
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user