From 92f6b28a41c94038efd702652a8f84f53a2c023d Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Thu, 5 Nov 2009 20:13:04 +0000 Subject: [PATCH] delete 2nd copy of groupfiles4dsh git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4489 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/tools/groupfiles4dsh | 124 -------------------- 1 file changed, 124 deletions(-) delete mode 100755 xCAT-server/share/xcat/tools/groupfiles4dsh diff --git a/xCAT-server/share/xcat/tools/groupfiles4dsh b/xCAT-server/share/xcat/tools/groupfiles4dsh deleted file mode 100755 index 2e103b436..000000000 --- a/xCAT-server/share/xcat/tools/groupfiles4dsh +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/perl -# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -#(C)IBM Corp -# - -BEGIN -{ - $::XCATROOT = - $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} - : -d '/opt/xcat' ? '/opt/xcat' - : '/usr'; -} -use lib "$::XCATROOT/lib/perl"; -use Getopt::Long; -use xCAT::MsgUtils; -use xCAT::Utils; - -#----------------------------------------------------------------------------- - -=head1 groupfiles4dsh - - - This tool will build a directory of files for each defined - nodegroup in xCAT. The file will be named the nodegroup name and - contain a list of nodes that belong to the nodegroup. - The file can be used as input to the AIX dsh command run in the DSH - context. - The purpose of this tool is to allow backward compatiblity with scripts - that were created using the AIX or CSM dsh command. - - - groupfiles4dsh -p - example: groupfiles4dsh -p /tmp/dshnodegrpfiles - - Use: export DSH_CONTEXT=DSH ( default unless CSM is installed) - export DSH_NODE_RSH=/bin/ssh (default is rsh) - export DSH_NODEGROUP_PATH= /tmp/dshnodegrpfiles - - dsh -N all date ( all is a group in xCAT) - dsh -a date ( see man dsh, DSH context) - -=cut - -#----------------------------------------------------------------------------- -# Main -my $rc = 0; -&parse_args; -my $cmd = "lsdef -t group"; -my @grpoutput = xCAT::Utils->runcmd($cmd, 0); -if ($::RUNCMD_RC != 0) -{ # error - xCAT::MsgUtils->message("E", "Error running $cmd"); - exit 1; -} -foreach my $group (@grpoutput) -{ - my $cmd = "nodels $group > $::PATH/$group"; - xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { # error - xCAT::MsgUtils->message("E", "Error running $cmd\n"); - exit 1; - } - -} -exit $rc; - -#----------------------------------------------------------------------------- - -=head3 parse_args - - Parses for input - -=cut - -#----------------------------------------------------------------------------- -sub parse_args -{ - my $msg; - my $usagemsg; - $usagemsg = - "groupfiles4dsh -h \ngroupfiles4dsh -v \ngroupfiles4dsh [-p] [path to group files directory]"; - Getopt::Long::Configure("posix_default"); - Getopt::Long::Configure("no_gnu_compat"); - Getopt::Long::Configure("bundling"); - if ( - !GetOptions( - 'p|path=s' => \$::PATH, - 'h|help' => \$::HELP, - 'v|version' => \$::VERSION - - ) - ) - { - xCAT::MsgUtils->message("E", $usagemsg); - exit 1; - } - if ($::HELP) - { - xCAT::MsgUtils->message("I", $usagemsg); - exit 0; - } - if ($::VERSION) - { - my $version = xCAT::Utils->Version(); - xCAT::MsgUtils->message("I", $version); - exit 0; - } - if (!($::PATH)) - { - my $msg = - "Requires -p with path to existing directory to hold group files."; - xCAT::MsgUtils->message("E", $msg); - exit 1; - } - if (!(-d $::PATH)) - { - my $msg = " Input directory must exist."; - xCAT::MsgUtils->message("E", $msg); - exit 1; - } - -} -