Skip to content

Commit

Permalink
fix host domainname suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
hurngchunlee committed May 29, 2019
1 parent 71de716 commit 818cbec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,9 @@ When the username is specified by the "-u" option, only the VNCs owned by the us
// 1. read machinelist from user provided hosts from commandline arguments
sort.Strings(args)
for _, n := range args {

if !strings.HasSuffix(n, fmt.Sprintf(".%s", NetDomain)) {
n = fmt.Sprintf("%s.%s", n, NetDomain)
}

log.Debugf("add node %s\n", n)
mlist = append(mlist, n)
}
Expand All @@ -415,7 +413,11 @@ When the username is specified by the "-u" option, only the VNCs owned by the us
defer fml.Close()
scanner := bufio.NewScanner(fml)
for scanner.Scan() {
mlist = append(mlist, scanner.Text())
n := scanner.Text()
if !strings.HasSuffix(n, fmt.Sprintf(".%s", NetDomain)) {
n = fmt.Sprintf("%s.%s", n, NetDomain)
}
mlist = append(mlist, n)
}

if err := scanner.Err(); err != nil {
Expand Down

0 comments on commit 818cbec

Please sign in to comment.