Skip to content

Commit

Permalink
Implements #85
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Feb 11, 2022
1 parent 3467aae commit 13bae55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""Util functions."""

import json
from urllib3 import Retry
import yaml
import requests
import os
Expand Down Expand Up @@ -273,6 +274,14 @@ def reLoadToscaTemplates(directory, oldToscaTemplates, delay):
return toscaTemplates


def toscaHasImages(template):
for node in list(template['topology_template']['node_templates'].values()):
if node["type"] == "tosca.nodes.indigo.Compute":
if not node.get("capabilities", {}).get("os", {}).get("properties", {}).get("image", {}):
return False
return True


def extractToscaInfo(toscaDir, tosca_pars_dir, toscaTemplates):
toscaInfoOrder = toscaInfo = {}
for tosca in toscaTemplates:
Expand All @@ -286,6 +295,7 @@ def extractToscaInfo(toscaDir, tosca_pars_dir, toscaTemplates):
"icon": "https://cdn4.iconfinder.com/data/icons/mosaicon-04/512/websettings-512.png"
},
"enable_config_form": False,
"fixed_images": toscaHasImages(template),
"inputs": {},
"tabs": {}}

Expand Down

0 comments on commit 13bae55

Please sign in to comment.