| import os |
| import pdb |
| import sys |
| import tempfile |
| sys.path.append("/opt/tosca") |
| from translator.toscalib.tosca_template import ToscaTemplate |
| |
| from core.models import XOS, XOSVolume |
| |
| from xosresource import XOSResource |
| |
| class XOSXOS(XOSResource): |
| provides = "tosca.nodes.XOS" |
| xos_model = XOS |
| copyin_props = ["ui_port", "bootstrap_ui_port", "docker_project_name", "enable_build"] |
| |
| class XOSVolume(XOSResource): |
| provides = "tosca.nodes.XOSVolume" |
| xos_model = XOSVolume |
| copyin_props = ["host_path"] |
| name_field = "container_path" |
| |
| def get_xos_args(self, throw_exception=True): |
| args = super(XOSVolume, self).get_xos_args() |
| |
| xos_name = self.get_requirement("tosca.relationships.UsedByXOS", throw_exception=throw_exception) |
| if xos_name: |
| args["xos"] = self.get_xos_object(XOS, throw_exception=throw_exception, name=xos_name) |
| |
| return args |