From 52e779d464aaf9ac4cdc28cde4d5dd1c800edd07 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 2 Sep 2010 13:17:24 +0000 Subject: [PATCH] change xdsh -i to use xcatchroot on AIX git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7344 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 29c329d71..8d5fff765 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -3646,14 +3646,16 @@ sub parse_and_run_dsh if (defined($options{'rootimg'})) { # running against local host # diskless image - - if (!(-e ($options{'rootimg'}))) - { # directory does not exist + # need directory for Linux, just osimage name for AIX + if (xCAT::Utils->isLinux()) { + if (!(-e ($options{'rootimg'}))) + { # directory does not exist my $rsp = (); $rsp->{data}->[0] = "Input image directory $options{'rootimg'} does not exist."; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1); return; + } } # since we have no input nodes for running xdsh against the image @@ -4689,7 +4691,12 @@ sub parse_rsync_input_file_on_SN sub runlocal_on_rootimg { my ($class, $options, $imagename) = @_; - my $cmd = "chroot $$options{'rootimg'} $$options{'command'}"; + my $cmd; + if (xCAT::Utils->isAIX()) { # use xcatchroot + $cmd = "$::XCATROOT/bin/xcatchroot -i $$options{'rootimg'} \"$$options{'command'}\""; + } else { + $cmd = "chroot $$options{'rootimg'} $$options{'command'}"; + } my @output = xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) {