def test_get_config_sections(self): """ CONFIG (CORE): Retreive configuration section only """ expected_sections = [str(generate_uuid()), str(generate_uuid())] for section in expected_sections: config_core.set(section, str(generate_uuid()), str(generate_uuid())) sections = config_core.sections(use_cache=False) for section in expected_sections: assert section in sections
def sections(issuer=None): """ Return a list of the sections available. :param issuer: The issuer account. :returns: ['section_name', ...] """ kwargs = {'issuer': issuer} if not permission.has_permission(issuer=issuer, action='config_sections', kwargs=kwargs): raise exception.AccessDenied('%s cannot retrieve sections' % issuer) return config.sections()
def sections(issuer=None, vo='def', session=None): """ Return a list of the sections available. :param issuer: The issuer account. :param vo: The VO to act on. :param session: The database session in use. :returns: ['section_name', ...] """ kwargs = {'issuer': issuer} if not permission.has_permission(issuer=issuer, vo=vo, action='config_sections', kwargs=kwargs, session=session): raise exception.AccessDenied('%s cannot retrieve sections' % issuer) return config.sections(session=session)