Skip to content

Commit

Permalink
Fix reported issues #47 and #48 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Napsty authored Jul 10, 2020
1 parent 274dcee commit d8f9fa1
Showing 1 changed file with 11 additions and 2 deletions.
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

0 comments on commit d8f9fa1

Please sign in to comment.