def get_policy_targets(context, presentation):
    """
    Returns our target node templates and groups if we have them.
    """

    node_templates = []
    groups = []

    our_targets = presentation.targets
    if our_targets:
        all_node_templates = \
            context.presentation.get('service_template', 'topology_template', 'node_templates') \
            or {}
        all_groups = \
            context.presentation.get('service_template', 'topology_template', 'groups') \
            or {}

        for our_target in our_targets:
            if our_target in all_node_templates:
                node_templates.append(all_node_templates[our_target])
            elif our_target in all_groups:
                groups.append(all_groups[our_target])

    return node_templates, groups