Commit 453fd697 authored by Spiros Koulouzis's avatar Spiros Koulouzis

fixed typo

parent 88e4ea9e
...@@ -32,7 +32,7 @@ node_types: ...@@ -32,7 +32,7 @@ node_types:
requirements: requirements:
- host: - host:
capability: tosca.capabilities.ARTICONF.docker.Orchestrator capability: tosca.capabilities.ARTICONF.docker.Orchestrator
node: osca.nodes.ARTICONF.docker.Orchestrator node: tosca.nodes.ARTICONF.docker.Orchestrator
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
tosca.nodes.ARTICONF.docker.Orchestrator: tosca.nodes.ARTICONF.docker.Orchestrator:
...@@ -66,7 +66,7 @@ node_types: ...@@ -66,7 +66,7 @@ node_types:
tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes: tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes:
derived_from: osca.nodes.ARTICONF.docker.Orchestrator derived_from: tosca.nodes.ARTICONF.docker.Orchestrator
description: Kubernetes orchestrator description: Kubernetes orchestrator
attributes: attributes:
tokens: tokens:
...@@ -94,7 +94,7 @@ node_types: ...@@ -94,7 +94,7 @@ node_types:
#osca.nodes.ARTICONF.docker.Orchestrator.Swarm: #osca.nodes.ARTICONF.docker.Orchestrator.Swarm:
#derived_from: osca.nodes.ARTICONF.docker.Orchestrator #derived_from: tosca.nodes.ARTICONF.docker.Orchestrator
#description: swarm orchestrator #description: swarm orchestrator
#interfaces: #interfaces:
#Standard: #Standard:
......
...@@ -184,12 +184,16 @@ class Planner: ...@@ -184,12 +184,16 @@ class Planner:
for tosca_node_type in self.all_node_types: for tosca_node_type in self.all_node_types:
if tosca_node_type.startswith('tosca.nodes') and 'capabilities' in self.all_node_types[tosca_node_type]: if tosca_node_type.startswith('tosca.nodes') and 'capabilities' in self.all_node_types[tosca_node_type]:
logging.debug(' Node: ' + str(tosca_node_type)) logging.debug(' Node: ' + str(tosca_node_type))
print(' Node: ' + str(tosca_node_type))
for caps in self.all_node_types[tosca_node_type]['capabilities']: for caps in self.all_node_types[tosca_node_type]['capabilities']:
logging.debug(' ' + str( logging.debug(' ' + str(
self.all_node_types[tosca_node_type]['capabilities'][caps]['type']) + ' == ' + cap) self.all_node_types[tosca_node_type]['capabilities'][caps]['type']) + ' == ' + cap)
print(' ' + str(
self.all_node_types[tosca_node_type]['capabilities'][caps]['type']) + ' == ' + cap)
if self.all_node_types[tosca_node_type]['capabilities'][caps]['type'] == cap: if self.all_node_types[tosca_node_type]['capabilities'][caps]['type'] == cap:
candidate_nodes[tosca_node_type] = self.all_node_types[tosca_node_type] candidate_nodes[tosca_node_type] = self.all_node_types[tosca_node_type]
logging.debug(' candidate_node: ' + str(tosca_node_type)) logging.debug(' candidate_node: ' + str(tosca_node_type))
print(' candidate_node: ' + str(tosca_node_type))
candidate_child_nodes = {} candidate_child_nodes = {}
for node in candidate_nodes: for node in candidate_nodes:
...@@ -212,7 +216,6 @@ class Planner: ...@@ -212,7 +216,6 @@ class Planner:
for req in all_requirements: for req in all_requirements:
if 'capability' in req[next(iter(req))]: if 'capability' in req[next(iter(req))]:
capability = req[next(iter(req))]['capability'] capability = req[next(iter(req))]['capability']
# Find nodes in node_templates that have the capability # Find nodes in node_templates that have the capability
logging.info(' Looking for nodes in node_templates with capability: ' + capability) logging.info(' Looking for nodes in node_templates with capability: ' + capability)
capable_nodes = self.get_node_templates_by_capability(capability) capable_nodes = self.get_node_templates_by_capability(capability)
...@@ -251,6 +254,8 @@ class Planner: ...@@ -251,6 +254,8 @@ class Planner:
child_nodes = {} child_nodes = {}
for tosca_node_type in self.all_node_types: for tosca_node_type in self.all_node_types:
if tosca_node_type.startswith('tosca.nodes') and 'derived_from' in self.all_node_types[tosca_node_type]: if tosca_node_type.startswith('tosca.nodes') and 'derived_from' in self.all_node_types[tosca_node_type]:
print(parent_node_type_name)
print(tosca_node_type)
if parent_node_type_name == self.all_node_types[tosca_node_type]['derived_from']: if parent_node_type_name == self.all_node_types[tosca_node_type]['derived_from']:
child_nodes[tosca_node_type] = self.all_node_types[tosca_node_type] child_nodes[tosca_node_type] = self.all_node_types[tosca_node_type]
return child_nodes return child_nodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment