Commit c8f2eb34 authored by David Johnson's avatar David Johnson

Fix bug from the split ctl/nm days; also parse routable_pools "safely".

This was a holdover from the original profile with split ctl and nm
management nodes.  Now there is just a single ctl node by default, but
the IPs are still requested tied to the nm node.  So we were ignoring
the split and the custom naming options.

Then, the hunk o' perl that was pulling the addrs out of the manifest
was first just assuming the first cluster manifest had the proper addrs,
which is wrong; we have to look at all cluster manifests.  Then, we have
to ensure we are extracting public addrs for the NM node (which in the
non-split world is the ctl node).

So now the hunk o' perl is really large and is "safer".
parent f1361c18
......@@ -753,7 +753,7 @@ if bslink:
# Grab a few public IP addresses.
apool = IG.AddressPool("nm",params.publicIPCount)
apool = IG.AddressPool(params.networkManagerHost,params.publicIPCount)
class EmulabEncrypt(RSpec.Resource):
......@@ -370,7 +370,7 @@ else
if [ $GENIUSER -eq 1 ]; then
PUBLICADDRS=`cat $OURDIR/manifests.0.xml | perl -e 'while (<STDIN>) { while ($_ =~ m/\<emulab:ipv4 address="([\d.]+)\" netmask=\"([\d\.]+)\"/g) { print "$1\n"; } }' | xargs`
PUBLICADDRS=`cat $OURDIR/manifests.*.xml | perl -e '$found = 0; while (<STDIN>) { if ($_ =~ /\<[\d\w:]*routable_pool [^\>\<]*\/>/) { print STDERR "DEBUG: found empty pool: $_\n"; next; } if ($_ =~ /\<[\d\w:]*routable_pool [^\>]*client_id=['"'"'"]'$NETWORKMANAGER'['"'"'"]/) { $found = 1; print STDERR "DEBUG: found: $_\n" } if ($found) { while ($_ =~ m/\<emulab:ipv4 address="([\d.]+)\" netmask=\"([\d\.]+)\"/g) { print "$1\n"; } } if ($found && $_ =~ /routable_pool\>/) { print STDERR "DEBUG: end found: $_\n"; $found = 0; } }' | xargs`
for ip in $PUBLICADDRS ; do
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment