Remove password confirmation in config app

Small fix to manually clean up temp dir when creating new temp dir,
small fix to font awesome icons, change the jwt/keystone
validators to not use username/password
This commit is contained in:
Sam Chow 2018-07-17 10:57:56 -04:00
parent 496d94138c
commit f5a8116f5a
9 changed files with 61 additions and 96 deletions

View file

@ -51,6 +51,24 @@ class KeystoneV2Users(FederatedUsers):
return (True, None)
def at_least_one_user_exists(self):
logger.debug('Checking if any users exist in Keystone')
try:
keystone_client = kclient.Client(username=self.admin_username, password=self.admin_password,
tenant_name=self.admin_tenant, auth_url=self.auth_url,
timeout=self.timeout, debug=self.debug)
user_list = keystone_client.users.list(tenant_id=self.admin_tenant, limit=1)
if len(user_list) < 1:
return (False, None)
return (True, None)
except Exception as e:
# Catch exceptions to give the user our custom error message
logger.exception('Unable to list users in Keystone')
return (False, e.message)
def verify_credentials(self, username_or_email, password):
try:
keystone_client = kclient.Client(username=username_or_email, password=password,
@ -116,6 +134,19 @@ class KeystoneV3Users(FederatedUsers):
return (True, None)
def at_least_one_user_exists(self):
logger.debug('Checking if any users exist in admin tenant in Keystone')
try:
user_list = self._get_admin_client().users.list(self.admin_tenant, limit=1)
if len(user_list) < 1:
return (False, 'No users found in tenant: %s' % self.admin_tenant)
return (True, None)
except Exception as e:
# Catch exceptions to give the user our custom error message
logger.exception('Unable to list users in Keystone')
return (False, e.message)
def verify_credentials(self, username_or_email, password):
try:
keystone_client = kv3client.Client(username=username_or_email, password=password,