From c73beabd4b52f09cd62e3e3415c5ccd223087f2c Mon Sep 17 00:00:00 2001 From: dirajj Date: Wed, 14 Apr 2021 15:58:25 +0530 Subject: [PATCH] Update dlipower.py Fix for non-default Username --- dlipower/dlipower.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlipower/dlipower.py b/dlipower/dlipower.py index 835efdf..dd76dc2 100755 --- a/dlipower/dlipower.py +++ b/dlipower/dlipower.py @@ -349,7 +349,7 @@ def login(self): m = hashlib.md5() # nosec - The switch we are talking to uses md5 hashes m.update(form_response.encode()) - data = {'Username': 'admin', 'Password': m.hexdigest()} + data = {'Username': self.userid, 'Password': m.hexdigest()} headers = {'Content-Type': 'application/x-www-form-urlencoded'} try: @@ -510,7 +510,7 @@ def statuslist(self): except IndexError: # Finding the root of the table with the outlet info failed # try again assuming we're seeing the table for a user - # account insteaed of the admin account (tables are different) + # account instead of the admin account (tables are different) try: self._is_admin = False root = soup.findAll('th', text='#')[0].parent.parent.parent