parseGroup.py syntax update to the (new) FAS api
This commit is contained in:
parent
2a910653e2
commit
34000f3e37
2 changed files with 4 additions and 4 deletions
0
fedstats.py
Normal file → Executable file
0
fedstats.py
Normal file → Executable 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue