Revision a61a0813
b/lib/cmdlib/instance.py | ||
---|---|---|
562 | 562 |
if self.needed_locks[locking.LEVEL_NODE] is not locking.ALL_SET: |
563 | 563 |
self.needed_locks[locking.LEVEL_NODE].append(self.op.src_node_uuid) |
564 | 564 |
if not os.path.isabs(src_path): |
565 |
self.op.src_path = src_path = \
|
|
565 |
self.op.src_path = \ |
|
566 | 566 |
utils.PathJoin(pathutils.EXPORT_DIR, src_path) |
567 | 567 |
|
568 | 568 |
self.needed_locks[locking.LEVEL_NODE_RES] = \ |
... | ... | |
670 | 670 |
locked_nodes = self.owned_locks(locking.LEVEL_NODE) |
671 | 671 |
exp_list = self.rpc.call_export_list(locked_nodes) |
672 | 672 |
found = False |
673 |
for node in exp_list: |
|
674 |
if exp_list[node].fail_msg: |
|
673 |
for node_uuid in exp_list:
|
|
674 |
if exp_list[node_uuid].fail_msg:
|
|
675 | 675 |
continue |
676 |
if self.op.src_path in exp_list[node].payload: |
|
676 |
if self.op.src_path in exp_list[node_uuid].payload:
|
|
677 | 677 |
found = True |
678 |
self.op.src_node = node
|
|
679 |
self.op.src_node_uuid = self.cfg.GetNodeInfoByName(node).uuid
|
|
678 |
self.op.src_node = self.cfg.GetNodeInfo(node_uuid).name
|
|
679 |
self.op.src_node_uuid = node_uuid
|
|
680 | 680 |
self.op.src_path = utils.PathJoin(pathutils.EXPORT_DIR, |
681 | 681 |
self.op.src_path) |
682 | 682 |
break |
... | ... | |
730 | 730 |
if einfo.has_option(constants.INISECT_INS, "nic%d_mac" % idx): |
731 | 731 |
ndict = {} |
732 | 732 |
for name in list(constants.NICS_PARAMETERS) + ["ip", "mac"]: |
733 |
v = einfo.get(constants.INISECT_INS, "nic%d_%s" % (idx, name)) |
|
734 |
ndict[name] = v |
|
733 |
nic_param_name = "nic%d_%s" % (idx, name) |
|
734 |
if einfo.has_option(constants.INISECT_INS, nic_param_name): |
|
735 |
v = einfo.get(constants.INISECT_INS, nic_param_name) |
|
736 |
ndict[name] = v |
|
735 | 737 |
nics.append(ndict) |
736 | 738 |
else: |
737 | 739 |
break |
Also available in: Unified diff