def count(self):
        types = 0
        for key, value in key_value_list(self.blueprint):
            if key == 'relationship_types':
                types += len(value)

        return types
    def count(self):
        types = 0
        for key, value in key_value_list(self.blueprint):
            if key == 'capability_types':
                types += len(value)

        return types
Exemple #3
0
    def count(self):
        properties = 0
        for key, value in key_value_list(self.blueprint):
            if key == 'properties' and type(value) in (list, dict):
                properties += len(value)

        return properties
Exemple #4
0
    def count(self):

        node_templates_and_types = {}

        for key, value in key_value_list(self.blueprint):
            if key in ('node_templates', 'node_types'):
                node_templates_and_types.update(value)

        nodes_map = {}

        for node_name, node_body in node_templates_and_types.items():
            plain_node = yaml.dump(node_body)
            variables = re.findall(get_input_re, plain_node)
            variables.extend(re.findall(get_param_re, plain_node))
            nodes_map[node_name] = variables

        for node_1, props_1 in list(nodes_map.items()):
            for node_2, props_2 in list(nodes_map.items()):
                if node_1 == node_2:
                    continue

                if not set(props_1).isdisjoint(props_2):
                    nodes_map[node_1] = set(props_1).union(props_2)
                    del nodes_map[node_2]

        return len(nodes_map)
    def count(self):
        types = 0
        for key, value in key_value_list(self.blueprint):
            if key == 'artifact_types':
                types += len(value)

        return types
    def count(self):
        types = 0
        for key, value in key_value_list(self.blueprint):
            if key == 'node_templates':
                types += len(value)

        return types
Exemple #7
0
    def count(self):

        params = 0
        for key, value in key_value_list(self.blueprint):

            if key in ('interfaces', 'operations'):
                for interface, items in value.items():
                    if type(items) == dict:
                        params += len(items.get('inputs', dict()))

        return params
Exemple #8
0
    def count(self):
        total_steps = 0
        total_workflows = 0

        for key, value in key_value_list(self.blueprint):
            if key == 'workflows':
                total_workflows = len(value)

                for _, workflow_dict in value.items():
                    steps = workflow_dict.get('steps', [])
                    total_steps += len(steps)

                break

        if total_workflows > 0:
            return round(total_steps/total_workflows, 1)

        return 0
 def count(self):
     return sum(
         len(value) for key, value in key_value_list(self.blueprint)
         if key == 'relationship_templates')
 def count(self):
     return sum(
         len(value) for key, value in key_value_list(self.blueprint)
         if key == 'interfaces')