--- trunk/lib/Intel/AMT/SOAP.pm 2009/08/09 09:43:12 7 +++ trunk/lib/Intel/AMT/SOAP.pm 2009/08/09 18:22:56 16 @@ -10,10 +10,12 @@ use lib 'lib'; -my $amt_host = $ENV{'AMT_HOST'}; -my $amt_port = "16992"; -$main::amt_user = "admin"; -$main::amt_pass = $ENV{'AMT_PASSWORD'}; +sub soap_url { + my $amt_host = $ENV{'AMT_HOST'}; + my $amt_port = "16992"; + "http://$amt_host:$amt_port"; +} + my $amt_debug = 0; $amt_debug = $ENV{'AMT_DEBUG'} if defined($ENV{'AMT_DEBUG'}); @@ -76,11 +78,11 @@ my ($nas, $sas, $rcs); sub SOAP::Transport::HTTP::Client::get_basic_credentials { - return $main::amt_user => $main::amt_pass; + return 'admin' => $ENV{AMT_PASSWORD}; } sub init() { - my $proxybase = "http://$amt_host:$amt_port"; + my $proxybase = soap_url; my $schemabase = "http://schemas.intel.com/platform/client"; $nas = SOAP::Lite->new( @@ -105,7 +107,7 @@ sub _soap { my $name = shift; - my $proxybase = "http://$amt_host:$amt_port"; + my $proxybase = soap_url; my $schemabase = "http://schemas.intel.com/platform/client"; warn "call_soap $proxybase $name ",dump( @_ ); @@ -233,7 +235,6 @@ } sub print_general_info() { - printf "### AMT info on machine '%s' ###\n", $amt_host; printf "AMT version: %s\n", $amt_version;