Replace hostname -f with uname -n

This commit is contained in:
Kenjiro Nakayama
2015-04-07 01:22:06 +09:00
committed by Dawn Chen
parent 996ded35ff
commit 2e702b0c61
8 changed files with 8 additions and 14 deletions

View File

@@ -452,10 +452,7 @@ func fqdnSuffix() (string, error) {
if err != nil {
return "", err
}
hostname, err := exec.Command("hostname").Output()
if err != nil {
return "", err
}
hostname := strings.Split(string(fullHostname), ".")[0]
return strings.TrimSpace(string(fullHostname)[len(string(hostname)):]), nil
}
@@ -469,9 +466,6 @@ func (gce *GCECloud) List(filter string) ([]string, error) {
if err != nil {
return []string{}, err
}
if len(suffix) > 0 {
suffix = "." + suffix
}
listCall := gce.service.Instances.List(gce.projectID, gce.zone)
if len(filter) > 0 {
listCall = listCall.Filter("name eq " + filter)