if self.needed_locks[locking.LEVEL_NODE] is not locking.ALL_SET:
self.needed_locks[locking.LEVEL_NODE].append(self.op.src_node_uuid)
if not os.path.isabs(src_path):
- self.op.src_path = src_path = \
+ self.op.src_path = \
utils.PathJoin(pathutils.EXPORT_DIR, src_path)
self.needed_locks[locking.LEVEL_NODE_RES] = \
locked_nodes = self.owned_locks(locking.LEVEL_NODE)
exp_list = self.rpc.call_export_list(locked_nodes)
found = False
- for node in exp_list:
- if exp_list[node].fail_msg:
+ for node_uuid in exp_list:
+ if exp_list[node_uuid].fail_msg:
continue
- if self.op.src_path in exp_list[node].payload:
+ if self.op.src_path in exp_list[node_uuid].payload:
found = True
- self.op.src_node = node
- self.op.src_node_uuid = self.cfg.GetNodeInfoByName(node).uuid
+ self.op.src_node = self.cfg.GetNodeInfo(node_uuid).name
+ self.op.src_node_uuid = node_uuid
self.op.src_path = utils.PathJoin(pathutils.EXPORT_DIR,
self.op.src_path)
break
if einfo.has_option(constants.INISECT_INS, "nic%d_mac" % idx):
ndict = {}
for name in list(constants.NICS_PARAMETERS) + ["ip", "mac"]:
- v = einfo.get(constants.INISECT_INS, "nic%d_%s" % (idx, name))
- ndict[name] = v
+ nic_param_name = "nic%d_%s" % (idx, name)
+ if einfo.has_option(constants.INISECT_INS, nic_param_name):
+ v = einfo.get(constants.INISECT_INS, nic_param_name)
+ ndict[name] = v
nics.append(ndict)
else:
break