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

Two fixes #49

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix reported issues #47 and #48
  • Loading branch information
Napsty committed Jul 10, 2020
commit 05e62920b1385096daeb13b28aee6ce08be8d5bb
13 changes: 11 additions & 2 deletions check_esxi_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@
#@ Author : Claudio Kuenzler
#@ Reason : Add parameter (-S) for custom SSL/TLS protocol version
#@---------------------------------------------------
#@ Date : 20200710
#@ Author : Claudio Kuenzler
#@ Reason : Improve missing mandatory parameter error text (issue #47)
#@ Delete temporary openssl config file after use (issue #48)
#@---------------------------------------------------

from __future__ import print_function
import sys
Expand All @@ -284,7 +289,7 @@
import pkg_resources
from optparse import OptionParser,OptionGroup

version = '20200605'
version = '20200710'

NS = 'root/cimv2'
hosturl = ''
Expand Down Expand Up @@ -585,7 +590,7 @@ def getopts() :
mandatories = ['host', 'user', 'password']
for m in mandatories:
if not options.__dict__[m]:
print("mandatory parameter '--" + m + "' is missing\n")
print("mandatory option '" + m + "' not defined. read usage in help.\n")
parser.print_help()
sys.exit(-1)

Expand Down Expand Up @@ -1013,6 +1018,10 @@ def handler(signum, frame):
if perf == '|':
perf = ''

# Cleanup temporary openssl config
if sslproto:
os.remove(sslconfpath)

if GlobalStatus == ExitOK :
print("OK - Server: %s %s %s%s" % (server_info, SerialNumber, bios_info, perf))

Expand Down