feature 3018045

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6550 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jet777 2010-06-18 14:09:48 +00:00
parent 579af7d1e0
commit 5ae7a89cca

View File

@ -21,6 +21,7 @@ use strict;
use constant DEFAULT_LOG_FILE => "mktoolscenter.log";
my $surrogate = 0;
my %proxy = ('host',"",'port',"",'user',"",'pw',"");
my $nodels = "/opt/xcat/bin/nodels";
my %Options = ('interactive',"yes",'warnings','','log',"yes",'dump',"yes");
my @warnings;
@ -133,13 +134,20 @@ sub question {
# Begin main
#
GetOptions("s"=>\$surrogate, "l=s"=>\$logfile);
GetOptions("s"=>\$surrogate, "l=s"=>\$logfile,
"ph=s"=>\$proxy{host}, "pp=i"=>\$proxy{port},
"puser=s"=>\$proxy{user}, "ppw=s"=>\$proxy{pw});
if (@ARGV > 0) {
open(IN,"<",@ARGV[0]) || die "cannot open input file @ARGV[0]";
open(IN,"<",@ARGV[0]) || die "Cannot open input file @ARGV[0]";
$Options{interactive} = '';
}
if (($proxy{host} ne "") or ($proxy{port} ne "")) { # both or neither
die "Must specify both proxy host and port or neither"
unless (($proxy{host} ne "") and ($proxy{port} ne ""));
}
my $ARCH = `uname -m`;
chomp($ARCH);
my $WEIRDARCH = $ARCH;
@ -283,7 +291,18 @@ if ( mkdir($path) or mkdir($sandbox) or system("cp $srcdir/$util $repo") or syst
exit;
}
if ( system("chmod +x $repo/$util") or system("cd $repo; tar -zxf $asu") or system("cd $repo; ./$util --tui -m $machines")) {
my $optstr = "";
if ($proxy{host} ne "") {
$optstr = " --proxy-address $proxy{host} --proxy-port $proxy{port}";
if ($proxy{user} ne "") {
$optstr .= " --proxy-user $proxy{user}";
}
if ($proxy{pw} ne "") {
$optstr .= " --proxy-password $proxy{pw}";
}
}
if ( system("chmod +x $repo/$util") or system("cd $repo; tar -zxf $asu") or system("cd $repo; ./$util --tui -m $machines $optstr")) {
output("Error executing $repo/$util");
exit;
}