How to use get_project_admin_creds method in tempest

Best Python code snippet using tempest_python

dynamic_creds.py

Source:dynamic_creds.py Github

copy

Full Screen

...402 # TODO(gmann): Remove this method in favor of get_project_member_creds()403 # after the deprecation phase.404 def get_primary_creds(self):405 return self.get_credentials('primary')406 # TODO(gmann): Remove this method in favor of get_project_admin_creds()407 # after the deprecation phase.408 def get_admin_creds(self):409 return self.get_credentials('admin')410 # TODO(gmann): Replace this method with more appropriate name.411 # like get_project_alt_member_creds()412 def get_alt_creds(self):413 return self.get_credentials('alt')414 def get_system_admin_creds(self):415 return self.get_credentials(['admin'], scope='system')416 def get_system_member_creds(self):417 return self.get_credentials(['member'], scope='system')418 def get_system_reader_creds(self):419 return self.get_credentials(['reader'], scope='system')420 def get_domain_admin_creds(self):421 return self.get_credentials(['admin'], scope='domain')422 def get_domain_member_creds(self):423 return self.get_credentials(['member'], scope='domain')424 def get_domain_reader_creds(self):425 return self.get_credentials(['reader'], scope='domain')426 def get_project_admin_creds(self):427 return self.get_credentials(['admin'], scope='project')428 def get_project_alt_admin_creds(self):429 return self.get_credentials(['alt_admin'], scope='project')430 def get_project_member_creds(self):431 return self.get_credentials(['member'], scope='project')432 def get_project_alt_member_creds(self):433 return self.get_credentials(['alt_member'], scope='project')434 def get_project_reader_creds(self):435 return self.get_credentials(['reader'], scope='project')436 def get_project_alt_reader_creds(self):437 return self.get_credentials(['alt_reader'], scope='project')438 def get_creds_by_roles(self, roles, force_new=False, scope=None):439 roles = list(set(roles))440 # The roles list as a str will become the index as the dict key for...

Full Screen

Full Screen

preprov_creds.py

Source:preprov_creds.py Github

copy

Full Screen

...328 return self._creds.get('domain_reader')329 domain_reader = self._get_creds(['reader'], scope='domain')330 self._creds['domain_reader'] = domain_reader331 return domain_reader332 def get_project_admin_creds(self):333 if self._creds.get('project_admin'):334 return self._creds.get('project_admin')335 project_admin = self._get_creds(['admin'], scope='project')336 self._creds['project_admin'] = project_admin337 return project_admin338 def get_project_alt_admin_creds(self):339 # TODO(gmann): Implement alt admin hash.340 return341 def get_project_member_creds(self):342 if self._creds.get('project_member'):343 return self._creds.get('project_member')344 project_member = self._get_creds(['member'], scope='project')345 self._creds['project_member'] = project_member346 return project_member347 def get_project_alt_member_creds(self):348 # TODO(gmann): Implement alt member hash.349 return350 def get_project_reader_creds(self):351 if self._creds.get('project_reader'):352 return self._creds.get('project_reader')353 project_reader = self._get_creds(['reader'], scope='project')354 self._creds['project_reader'] = project_reader355 return project_reader356 def get_project_alt_reader_creds(self):357 # TODO(gmann): Implement alt reader hash.358 return359 def get_creds_by_roles(self, roles, force_new=False, scope=None):360 roles = list(set(roles))361 exist_creds = self._creds.get(str(roles).encode(362 'utf-8'), None)363 # The force kwarg is used to allocate an additional set of creds with364 # the same role list. The index used for the previously allocation365 # in the _creds dict will be moved.366 if exist_creds and not force_new:367 return exist_creds368 elif exist_creds and force_new:369 # NOTE(andreaf) In py3.x encode returns bytes, and b'' is bytes370 # In py2.7 encode returns strings, and b'' is still string371 new_index = str(roles).encode('utf-8') + b'-' + \372 str(len(self._creds)).encode('utf-8')373 self._creds[new_index] = exist_creds374 net_creds = self._get_creds(roles=roles)375 self._creds[str(roles).encode('utf-8')] = net_creds376 return net_creds377 def clear_creds(self):378 for creds in self._creds.values():379 self.remove_credentials(creds)380 # TODO(gmann): Remove this method in favor of get_project_admin_creds()381 # after the deprecation phase.382 def get_admin_creds(self):383 return self.get_creds_by_roles([self.admin_role])384 def is_role_available(self, role):385 if self.hash_dict['roles'].get(role):386 return True387 return False388 def admin_available(self):389 return self.is_role_available(self.admin_role)390 def _wrap_creds_with_network(self, hash):391 creds_dict = self.hash_dict['creds'][hash]392 # Make sure a domain scope if defined for users in case of V3393 # Make sure a tenant is available in case of V2394 creds_dict = self._extend_credentials(creds_dict)...

Full Screen

Full Screen

cred_provider.py

Source:cred_provider.py Github

copy

Full Screen

...67 @abc.abstractmethod68 def get_domain_reader_creds(self):69 return70 @abc.abstractmethod71 def get_project_admin_creds(self):72 return73 @abc.abstractmethod74 def get_project_alt_admin_creds(self):75 return76 @abc.abstractmethod77 def get_project_member_creds(self):78 return79 @abc.abstractmethod80 def get_project_alt_member_creds(self):81 return82 @abc.abstractmethod83 def get_project_reader_creds(self):84 return85 @abc.abstractmethod...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful