def run(self, test_execution, args): errors = utils.create_user(test_execution.root_path, args.username, args.password, args.admin, args.projects, args.reports) if errors: raise CommandException('\n'.join(errors)) else: print('User {} was created successfully'.format(args.username))
def createuser_command(username, password, is_admin=False, projects=[], reports=[]): errors = utils.create_user(test_execution.root_path, username, password, is_admin, projects, reports) if errors: sys.exit('golem createuser: error: {}'.format(' '.join(errors))) else: print('User {} was created successfully'.format(username))
def createuser_command(username, password, is_admin=False, projects=None, reports=None): projects = projects or [] reports = reports or [] errors = utils.create_user(username, password, is_admin, projects, reports) if errors: sys.exit('golem createuser: error: {}'.format(' '.join(errors))) else: print('User {} was created successfully'.format(username))