Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host.info printing "Maintenance Mode" without new line #2398

Closed
cpiment opened this issue Apr 30, 2021 · 2 comments · Fixed by #2408
Closed

host.info printing "Maintenance Mode" without new line #2398

cpiment opened this issue Apr 30, 2021 · 2 comments · Fixed by #2408

Comments

@cpiment
Copy link
Contributor

cpiment commented Apr 30, 2021

I'm using govc version v0.25.0 and when some of the hosts are on maintenance mode, the result of this command:

govc host.info '/dc/host/cluster/*'

Reads this way:

Name:                           X.company.com
  Path:                         /dc/host/cluster/X.server.company.com
  Manufacturer:                 HPE
  Logical CPUs:                 44 CPUs @ 2095MHz
  Processor type:               Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz
  CPU usage:                    156 MHz (0.2%)
  Memory:                       786084MB
  Memory usage:                 7155 MB (0.9%)
  Boot time:                    2021-04-27 06:09:37.130746 +0000 UTC
  State: Maintenance ModeName:  Y.company.com
  Path:                         /dc/host/cluster/X.server.company.com
  Manufacturer:                 HPE
  Logical CPUs:                 44 CPUs @ 2095MHz
  Processor type:               Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz
  CPU usage:                    40429 MHz (43.9%)
  Memory:                       786084MB
  Memory usage:                 338520 MB (43.1%)
  Boot time:                    2020-08-02 18:03:10.532999 +0000 UTC
  State:                        connected

The last line (State) gets mixed with the first line of the next host of the cluster.

I think that the problem is the lack of the new-line character in this line of code:

fmt.Fprint(tw, " State: Maintenance Mode")

Which is present in the following line:

fmt.Fprintf(tw, " State:\t%s\n", s.Runtime.ConnectionState)

Should I open a PR with this change? It feels kind of silly, but is bugging me in my host.info listings 😅

@dougm
Copy link
Member

dougm commented May 3, 2021

Not silly at all, please do open a PR!

@cpiment
Copy link
Contributor Author

cpiment commented May 5, 2021

Thanks, I have just opened the PR.

protochron pushed a commit to protochron/govmomi that referenced this issue Aug 31, 2021
yuyin002 pushed a commit to yuyin002/govmomi that referenced this issue Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants