LGTM, thanks
On Mon, Aug 19, 2013 at 2:13 PM, Thomas Thrainer <[email protected]>wrote: > This patch fixes a bug where node names were incorrectly used as node > UUID's. > > Signed-off-by: Thomas Thrainer <[email protected]> > --- > lib/cmdlib/instance.py | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py > index 529a492..137f2af 100644 > --- a/lib/cmdlib/instance.py > +++ b/lib/cmdlib/instance.py > @@ -562,7 +562,7 @@ class LUInstanceCreate(LogicalUnit): > 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] = \ > @@ -670,13 +670,13 @@ class LUInstanceCreate(LogicalUnit): > 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 > @@ -730,8 +730,10 @@ class LUInstanceCreate(LogicalUnit): > 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 > -- > 1.8.3 > >
