From b52a7f7ee589e82710bce9a9bf02a7d3eece246d Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 9 Jan 2013 18:39:30 +0000 Subject: [PATCH] add support for non-root user running updatenode -S git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14832 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 19afd2937..5e2185e70 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -1520,23 +1520,27 @@ sub updatenodesoftware { $cmd = "$installdir/postscripts/xcatdsklspost 2 -M $snkey 'ospkgs,otherpkgs' --tftp $tftpdir" ; - $args1 = [ - "--nodestatus", - "-s", - "-v", - "-e", - "$cmd" - ]; } else { - $cmd = "$installdir/postscripts/xcatdsklspost 2 -m $snkey 'ospkgs,otherpkgs' --tftp $tftpdir"; - $args1 = [ + } + # build xdsh command + if (defined($::USER)){ # non-root user + $args1 = [ + "--nodestatus", + "--sudo", + "-s", + "-v", + "-e", + "$cmd" + ]; + } else { # root + $args1 = [ "--nodestatus", "-s", "-v",