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:
ir;
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:
ir->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
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:
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:
@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