1 |
*** pbs.in.orig 2008-11-24 16:37:11.000000000 +0100 |
2 |
--- pbs.in 2009-02-16 21:56:49.000000000 +0100 |
3 |
*************** |
4 |
*** 366,371 **** |
5 |
--- 366,398 ---- |
6 |
$rsh_env .= $tuple->[0] . '="' . $tuple->[1] . "\";\n" |
7 |
. 'export ' . $tuple->[0] . ";\n"; |
8 |
} |
9 |
+ |
10 |
+ ############################################################################### |
11 |
+ # Extract VO name for later use in variable definition |
12 |
+ ############################################################################### |
13 |
+ my $proxylocation; |
14 |
+ my $voname; |
15 |
+ foreach my $tuple ($description->environment()) { |
16 |
+ $proxylocation = $tuple->[1] if $tuple->[0] eq "X509_USER_PROXY"; |
17 |
+ } |
18 |
+ if ( defined ($proxylocation) ) { |
19 |
+ print JOB '# Inspecting proxy '.$proxylocation."\n"; |
20 |
+ [ -x "/opt/glite/bin/voms-proxy-info" ] and do { |
21 |
+ my $voname=`/opt/glite/bin/voms-proxy-info -file "$proxylocation" -vo 2>/dev/null`; |
22 |
+ chomp($voname); |
23 |
+ if ( $voname =~ /[a-zA-Z][\w\d\.]*/ ) { |
24 |
+ print JOB "# VO name from proxy is $voname\n"; |
25 |
+ $rsh_env .= 'VONAME="' . $voname . "\";\n" |
26 |
+ . 'export ' . "VONAME" . ";\n"; |
27 |
+ push(@new_env, "VONAME" . '="' . $voname . '"'); |
28 |
+ } else { |
29 |
+ print JOB "# VO name from proxy is NOT valid\n"; |
30 |
+ } |
31 |
+ }; |
32 |
+ } else { |
33 |
+ print JOB "# Proxy location undefined, VO not set\n"; |
34 |
+ } |
35 |
+ |
36 |
############################################################################### |
37 |
# TeraGrid -- Do not reset library variables |
38 |
# 06/30/2005, JP Navarro <navarro@mcs.anl.gov> |
39 |
|