Exemple #1
0
def loadCloudAPISettings(registry):
    cloudapis_settings = registry.max_store.cloudapis.find_one()
    if cloudapis_settings:
        return cloudapis_settings
    else:
        maxlogger.info("No cloudapis info found. Please run initialization database script.")  # pragma: no cover
        return DUMMY_CLOUD_API_DATA
Exemple #2
0
def loadMAXSecurity(registry):
    from max.models import Security
    from collections import namedtuple
    Request = namedtuple('Request', ['db'])
    security_settings = [a for a in registry.max_store.security.find({})]
    if security_settings:
        return Security.from_object(Request(registry.max_store), security_settings[0])
    else:
        maxlogger.info("No security info found. Please run initialization database script.")  # pragma: no cover