Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print satatement does not output my array value to BDII

Status
Not open for further replies.

goteng

Programmer
Jan 27, 2011
1
GB
Hi everyone,

I have written a plugin in perl script that is expected to be published in the BDII (GRIS). The script prints from the standard output on my command line but it does not publish one of the array variables called @Store_MPICH to the BDII. I wonder if variable decaled within some loops do not get published or transferred to another publishing system. All other variables are showing in my BDII publishing except the @Store_MPICH, even though it prints on my screen when I run the script on my command line. The script is:


#! /usr/bin/env perl
use warnings;
use IO::File;
use IO::Dir;
use IPC::Open3;

my $Pub_prefix="NGS-UEE-";
my $Pub_version="NGS-UEE_1_0";

$Siteinfo_file="/etc/grid-security/siteinfo/site-info.def";
$Sw_env="CE_RUNTIMEENV";
$MPICH_tag="MPICH";
my $UEE_dir="/usr/ngs";
exit unless -d $UEE_dir;


my @Default_tags = ();

my $Default_tags_file = "$UEE_dir" . "/default-tags";
if ( -f $Default_tags_file ) {
@Default_tags = map { split /\s+/ }
( IO::File->new($Default_tags_file)->getlines );
}

$fqdn=$ENV{CE_HOSTNAME} || (qx{/bin/hostname --fqdn} =~ m{(\S+)})[0];

$dn="GlueSubClusterUniqueID=$fqdn,GlueClusterUniqueID=$fqdn,mds-vo-name=resource,o=grid";
my @tags = sort grep { /^[A-Z0-9]+_?/ } ( IO::Dir->new($UEE_dir)->read );
@Site_entries = ();
@Store_MPICH = ();
if ( -f $Siteinfo_file ) {
@Site_entries = ( IO::File->new($Siteinfo_file)->getlines );
}
foreach $x (@Site_entries) {
if (index($x,"#")==0) { next; } # Comments should be skipped
@line=split("=", $x);
chomp(@line);
if ($line[0]=~ /$Sw_env/i) {
chomp $line[1];
@values= split(" ", $line[1]);
chomp(@values);
foreach $y (@values) {
if ( $y =~ /$MPICH_tag/i ) {
@Store_MPICH = $y;
}
}
}
}

print "dn: $dn\n";
print "GlueHostApplicationSoftwareRunTimeEnvironment: @{Store_MPICH}\n";
print "GlueHostApplicationSoftwareRunTimeEnvironment: ${Pub_version}\n";
for my $t (@Default_tags, @tags) {
print "GlueHostApplicationSoftwareRunTimeEnvironment: ${Pub_prefix}$t\n";
}
print "\n";



Any help is appreciated
Gokop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top