Replace hostname -f with uname -n
This commit is contained in:

committed by
Dawn Chen

parent
996ded35ff
commit
2e702b0c61
@@ -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)
|
||||
|
Reference in New Issue
Block a user