Commit 218346dd by Rahul Dutta

Bug fixes for Compose node id

parent b5e88e3e
......@@ -20,6 +20,9 @@ from valence.controller import flavors
from valence.db import api as db_api
from valence.podmanagers import manager
from valence.provision import driver
from valence.redfish import redfish
LOG = logging.getLogger(__name__)
......@@ -37,6 +40,7 @@ class Node(object):
self.podm_id = podm_id
LOG.error("Compose init triggered" + str(podm_id))
if node_id:
self.node = db_api.Connection.get_composed_node_by_uuid(node_id).\
......@@ -77,7 +81,9 @@ class Node(object):
#changes done as part of M2DC Project for allocating and assembling node
if "allocate" in request_body:
allocated_node=self.connection.allocate_node(name, description, requirements)
allocated_node=redfish.allocate_node(name, description, requirements)
return allocated_node
......@@ -86,18 +92,21 @@ class Node(object):
if "assemble" in request_body:
assembled_node=self.connection.assemble_node(name, description, requirements)
assembled_node=redfish.assemble_node(name, description,compose_id, requirements)
assemble_node["uuid"] = utils.generate_uuid()
assembled_node["uuid"] = utils.generate_uuid()
# Only store the minimum set of composed node info into backend db,
# since other fields like power status may be changed and valence is
# not aware.
node_db = {"uuid": assemble_node["uuid"],
node_db = {"uuid": utils.generate_uuid(),
"podm_id": self.podm_id,
"name": assemble_node["name"],
"index": assemble_node["index"],
"resource_uri": assemble_node["resource_uri"]}
"name": assembled_node["name"],
"index": assembled_node["index"],
"resource_uri": assembled_node["resource_uri"]}
return self._show_node_brief_info(assembled_node)
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 sign in to comment