Ejemplo n.º 1
0
def team_constructor(loader, node):
    if isinstance(node, yaml.ScalarNode):
        item = loader.construct_scalar(node)
        if not isinstance(item, str) or not item:
            raise ConfigurationError(
                'value {} cannot be interpreted as team'.format(item))
    elif isinstance(node, yaml.MappingNode):
        item = loader.construct_mapping(node)
        if not isinstance(item, dict) or not item:
            raise ConfigurationError(
                'value {} cannot be interpreted as team'.format(item))
    return TeamManager().get_object(item)
Ejemplo n.º 2
0
def exo_account_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as account'.format(item)
        )

    return ExoAccountManager().get_object(item)
Ejemplo n.º 3
0
def group_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as an opportunity group'.format(item))
    return GroupManager().get_object(item)
Ejemplo n.º 4
0
def user_constructor(loader, node):
    item = loader.construct_mapping(node=node)
    if not isinstance(item, dict) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as an opportunity'.format(item))
    return UserManager().get_object(item)
Ejemplo n.º 5
0
def landing_constructor(loader, node):
    item = loader.construct_mapping(node=node)
    if not isinstance(item, dict) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as a page'.format(item))
    return LandingManager().get_object(item)
Ejemplo n.º 6
0
def qa_session_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted QA Session'.format(item))
    return QaSessionManager().get_object(item)
Ejemplo n.º 7
0
def forum_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as post'.format(item))
    return ForumManager().get_object(item)
Ejemplo n.º 8
0
def generic_project_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as generic project'.format(item))
    return GenericProjectManager().get_object(item)
Ejemplo n.º 9
0
def survey_reference_constructor(loader, node):
    item = loader.construct_scalar(node=node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as an survey'.format(item))
    return SurveyManager().get_object(item)
Ejemplo n.º 10
0
def referral_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as campaign'.format(item))
    return ReferralManager().get_object(item)
Ejemplo n.º 11
0
def sprint_automated_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as consultant'.format(item))
    return SprintAutomatedManager().get_object(item)
def certification_cohort_constructor(loader, node):
    item = loader.construct_scalar(node)
    if not isinstance(item, str) or not item:
        raise ConfigurationError(
            'value {} cannot be interpreted as certification cohort'.format(item))
    return CertificationCohortManager().get_object(item)