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

Fix: #72 deprecation of pkg_resources #71

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions check_esxi_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,17 @@
#@ Author : Claudio Kuenzler
#@ Reason : Fix bug when missing S/N (issue #68)
#@---------------------------------------------------
#@ Date : 20240223
#@ Author : Julian Petri
#@ Reason : Fix deprecation of pkg_resources (issue #72)
#@---------------------------------------------------

from __future__ import print_function
import sys
import time
import pywbem
import re
import pkg_resources
import importlib.metadata
import json
from optparse import OptionParser,OptionGroup

Expand Down Expand Up @@ -734,7 +738,7 @@ def handler(signum, frame):
try:
pywbemversion = pywbem.__version__
except:
pywbemversion = pkg_resources.get_distribution("pywbem").version
pywbemversion = importlib.metadata.version("pywbem")
else:
pywbemversion = pywbem.__version__
verboseoutput("Found pywbem version "+pywbemversion)
Expand Down