def get_yaml_data(self): """ Returns yaml data for this provider. """ if hasattr(self, 'provider_data') and self.provider_data is not None: return self.provider_data elif self.key is not None: return conf.cfme_data['management_systems'][self.key] else: raise ProviderHasNoKey( 'Provider {} has no key, so cannot get yaml data'.format( self.name))
def mgmt(self): """ Returns the mgmt_system using the :py:func:`utils.providers.get_mgmt` method. """ # gotta stash this in here to prevent circular imports from cfme.utils.providers import get_mgmt if self.key: return get_mgmt(self.key) elif getattr(self, 'provider_data', None): return get_mgmt(self.provider_data) else: raise ProviderHasNoKey( 'Provider {} has no key, so cannot get mgmt system'.format(self.name))
def get_mgmt_system(self): """ Returns the mgmt_system using the :py:func:`utils.providers.get_mgmt` method. """ # gotta stash this in here to prevent circular imports from utils.providers import get_mgmt credentials = {'token': self.get_bearer_token()} if self.key: return get_mgmt(self.key, credentials=credentials) elif hasattr(self, 'provider_data'): return get_mgmt(self.provider_data, credentials=credentials) else: raise ProviderHasNoKey( 'Provider {} has no key, so cannot get mgmt system'.format( self.name))