diff options
author | Radomir Dopieralski <openstack@sheep.art.pl> | 2013-10-24 10:35:49 +0200 |
---|---|---|
committer | Radomir Dopieralski <openstack@sheep.art.pl> | 2013-10-25 10:39:32 +0200 |
commit | ad1bc9ca284193f2fe9cbfe7f6c9c9e4a08a91a0 (patch) | |
tree | cd6453ebcf68c823f0a65fe4ff5c123cf04d3cc8 | |
parent | b18e759990db0a369021f20dac855ba99862c131 (diff) | |
download | tuskar-ui-ad1bc9ca284193f2fe9cbfe7f6c9c9e4a08a91a0.tar.gz |
Use BaremetalNodes in the rack's nodes formset table
The formset table for editing rack's nodes need to get the
BaremetalNodes, not Nodes, because it needs all the info about CPUs,
Memory, etc.
Change-Id: I0ebaf3cb6a8cf075ac5574a7debf16e0291cb83d
-rw-r--r-- | tuskar_ui/api.py | 7 | ||||
-rw-r--r-- | tuskar_ui/infrastructure/resource_management/racks/workflows.py | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tuskar_ui/api.py b/tuskar_ui/api.py index d0abd2ba..68b2a413 100644 --- a/tuskar_ui/api.py +++ b/tuskar_ui/api.py @@ -449,6 +449,13 @@ class Rack(StringIdAPIResourceWrapper): return self._nodes @property + def list_baremetal_nodes(self): + if not hasattr(self, '_baremetal_nodes'): + self._baremetal_nodes = [node.nova_baremetal_node + for node in self.list_nodes] + return self._baremetal_nodes + + @property def nodes_count(self): return len(self.nodes) diff --git a/tuskar_ui/infrastructure/resource_management/racks/workflows.py b/tuskar_ui/infrastructure/resource_management/racks/workflows.py index f47a9915..8cf0438f 100644 --- a/tuskar_ui/infrastructure/resource_management/racks/workflows.py +++ b/tuskar_ui/infrastructure/resource_management/racks/workflows.py @@ -135,7 +135,7 @@ class EditNodes(CreateNodes): def get_nodes_data(self): rack_id = self.workflow.context['rack_id'] rack = tuskar.Rack.get(self.workflow.request, rack_id) - return rack.list_nodes + return rack.list_baremetal_nodes class CreateRack(workflows.Workflow): @@ -208,6 +208,7 @@ class CreateRack(workflows.Workflow): exceptions.handle(self.request, _("Unable to update node.")) return False else: + # Rack.create takes a list of dicts with BaremetalNode ids node_ids.append({'id': node_id}) try: # Then, register the Rack, including the nodes |