- Timestamp:
- May 24, 2010 9:23:51 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 301e941
- Parents:
- 8fc0606
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/federate.pl
r8fc0606 rd56b168 23 23 my $local_config_dir = "/usr/local/federation/etc"; 24 24 my %services; 25 my %aliases; 26 my @added; 25 27 my $perl; 26 28 … … 92 94 /ProjectName:\s+(.*)/i && do { $smbproject = $1; }; 93 95 /Service:\s+(.*)/i && do { $services{$1}++;}; 96 /PortalAlias:\s+(.*)/i && do { $aliases{$1}++;}; 97 /AddedNode:\s+(.*)/i && do { push(@added, $1)}++;}; 98 } 99 100 # If nodes have been added with this name, do not alias the name to the portal 101 for my $a (@added) { 102 chomp $a; 103 delete $aliases{$a} if $aliases{$a}; 94 104 } 95 105 $client->close(); … … 103 113 while (<$hosts>) { 104 114 /^127\.0\.0\.1/ && do { print $new_hosts $_; }; 105 /control\./ && $has_control++; 115 # If aliases conflict with existing nodes, delete the alias 116 for my $n (split($_)) { 117 chomp $n; 118 delete $aliases{$n} if $aliases{$n}; 119 } 106 120 } 107 121 $hosts->close(); … … 111 125 $config_hosts->close(); 112 126 113 # If seer is enabled and no local control node in play, alias the gateway to be 114 # control 127 # Add gateway aliases 115 128 if ($services{'seer'} && !$has_control ) { 116 129 if ( my $hent = gethostbyname($gateway) ) { 117 130 my $gwip = inet_ntoa($hent->addr_list->[0]); 118 131 119 print $new_hosts "\n$gwip\tcontrol.$exp.$proj\n"; 132 for my $k (keys %aliases) { 133 print $new_hosts "\n$gwip\t$k.$exp.$proj\n"; 134 } 120 135 } 121 136 }
Note: See TracChangeset
for help on using the changeset viewer.