Skip to content

Commit

Permalink
Merge pull request #4 from XiaoliChan/wmi-improv-admin-check
Browse files Browse the repository at this point in the history
[wmi] bug fix in 'check_admin' function
  • Loading branch information
Marshall-Hallenbeck authored Sep 17, 2023
2 parents 2f0b74a + e3837d9 commit 04a6ba7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cme/protocols/wmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def check_if_admin(self):
if "dcom" in locals():
dcom.disconnect()

if not str(e).find("access_denied") > 0:
if "access_denied" not in str(e).lower():
self.logger.fail(str(e))
else:
if not flag or not self.stringBinding:
Expand All @@ -188,7 +188,7 @@ def check_if_admin(self):
except Exception as e:
dcom.disconnect()

if not str(e).find("access_denied") > 0:
if "access_denied" not in str(e).lower():
self.logger.fail(str(e))
else:
dcom.disconnect()
Expand Down
5 changes: 2 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 04a6ba7

Please sign in to comment.