def toggleSelection(self):
index = self.currentIndex()
model = index.model()
+
+ if (model == None):
+ # probably no rspec downloaded yet
+ return
+
status_index = model.index(index.row(), MEMBERSHIP_STATUS_COLUMN, index.parent())
status_data = status_index.data().toString()
node_index = model.index(index.row(), NAME_COLUMN, index.parent())
# Right click
index = self.currentIndex()
model = index.model()
+
+ if (model == None):
+ # probably no rspec downloaded yet
+ return
+
status_index = model.index(index.row(), 1, index.parent())
status_data = status_index.data().toString()
node_index = model.index(index.row(), 0, index.parent())
self.nodeView.appendRow(nodeItem, tagstring, membership=tag_status['in'], kind = "attribute")
for node in sliver_nodes:
+ nodeType = None
+ if ("hardware_types" in node):
+ hardware_types = [x["name"] for x in node["hardware_types"]]
+ nodeType = ",".join(hardware_types)
+ nodeStatus = node.get("boot_state", "")
+ if nodeStatus == None:
+ nodeStatus=""
nodeItem = self.nodeView.appendRow(networkItem,
node["component_name"],
- nodeStatus=node.get("boot_state", ""),
- #nodeType=node.get("rspec.get_node_sliver_type(node, network),
+ nodeStatus=nodeStatus,
+ nodeType=nodeType,
membership=node_status['in'],
kind="node")
kind="attribute")
for node in available_nodes:
+ nodeType = None
+ if ("hardware_types" in node):
+ hardware_types = [x["name"] for x in node["hardware_types"]]
+ nodeType = ",".join(hardware_types)
+ nodeStatus = node.get("boot_state", "")
+ if nodeStatus == None:
+ nodeStatus=""
self.nodeView.appendRow(networkItem,
node["component_name"],
- nodeStatus = node.get("boot_state", ""),
- #nodeType= resources.get_node_sliver_type(node, network),
+ nodeStatus=nodeStatus,
+ nodeType=nodeType,
membership=node_status['out'],
kind="node")