def group_users(self, group_name): group_json = dict() account = AccountSystem(username=self.username, password=self.password) try: group_json = account.group_members(group_name) except AuthError: print("[*] Invalid Username / Password") return 1 userlist = [user_desc.values()[0] for user_desc in group_json] return userlist
def group_users(self, group_name): userlist = list() group_json = {} account = AccountSystem(username=self.username, password=self.password) try: group_json = account.group_members(group_name) except AuthError: print("[*] Invalid Username / Password") for user_desc in group_json: userlist.append(user_desc.values()[0]) return userlist
except configparser.Error as err: sys.stderr.write("Bad configuration file: {0}".format(err)) sys.exit(1) #client.username = "******" #client.password = "******" raw_config = configparser.ConfigParser() filepath = os.path.join(os.path.expanduser("~"), ".config", "fedora") config = {} if raw_config.read(filepath): client.username = config_value(raw_config, "username") client.password = config_value(raw_config, "password") try: packagers = client.group_members("packager") except AuthError as e: client.username = raw_input('Username: '******'Password: '******'user': approved_date = datetime.datetime.strptime( role.approval, '%Y-%m-%d %H:%M:%S.%f+00:00') if approved_date > datetime.datetime.today() - datetime.timedelta(