parseGroup.py syntax update to the (new) FAS api

This commit is contained in:
bt0dotninja 2020-03-11 08:31:00 -06:00
commit 34000f3e37
2 changed files with 4 additions and 4 deletions

0
fedstats.py Normal file → Executable file
View file

View file

@ -10,14 +10,14 @@ class GroupParser:
self.config = configparser.RawConfigParser()
try:
self.config.read('config.cfg')
self.username = self.config.get('fas', 'username').strip('\'')
self.password = self.config.get('fas', 'password').strip('\'')
self.username = self.config.get('FAS', 'user').strip('\'')
self.password = self.config.get('FAS', 'pass').strip('\'')
self.check_config()
except:
print("[*] Invalid / Missing Configuration file.")
def check_config(self):
if self.username.strip('\'') == 'FAS_USERNAME_HERE':
print("[*] Please enter FAS credentials in fas_credentials.cfg")
print("[*] Please enter FAS credentials in config.cfg")
return False
else:
return True
@ -31,5 +31,5 @@ class GroupParser:
except AuthError:
print("[*] Invalid Username / Password")
return 1
userlist = [user_desc.values()[0] for user_desc in group_json]
userlist = [user_desc['username'] for user_desc in group_json]
return userlist