Beispiel #1
0
 def _node_data_get_interface(self, node):
     """
     Get interface for node from tosca
     """
     interfaces = utils.get_lifecycle(node, "Occopus")
     if not interfaces:
         logger.debug("No interface for Occopus in {}".format(node.name))
     return interfaces
Beispiel #2
0
 def _get_terraform_interface(self, node):
     """
     Return tosca interfaces for the node
     """
     interfaces = utils.get_lifecycle(node, "Terraform")
     if not interfaces:
         logger.debug("No interface for Terraform in {}".format(node.name))
     return interfaces
Beispiel #3
0
def get_container_info(node, repositories):
    """Check the node name for errors (underscores)

    Returns:
        toscaparser.nodetemplate.NodeTemplate: a deepcopy of a NodeTemplate
    """
    if not repositories:
        repositories = []
    NodeInfo = namedtuple(
        "NodeInfo",
        [
            "name",
            "type",
            "properties",
            "inputs",
            "artifacts",
            "parent",
            "sidecars",
            "mounts",
            "hosts",
            "requirements",
            "repositories",
        ],
    )
    return NodeInfo(
        name=node.name,
        type=node.type,
        properties={x: y.value
                    for x, y in node.get_properties().items()},
        inputs=utils.get_lifecycle(node,
                                   Interface.KUBERNETES).get("create", {}),
        artifacts=node.entity_tpl.get("artifacts", {}),
        parent=node.type_definition.defs,
        sidecars=_get_related_nodes(node, NodeType.CONTAINER, repositories),
        mounts=_get_related_mounts(node),
        hosts=_get_related_hosts(node),
        requirements=node.requirements,
        repositories={repo.name: repo.reposit
                      for repo in repositories},
    )