[Bug 1373261] Re: pserv.yaml rewrite breaks when MAAS URL uses IPv6 address
Jeroen T. Vermeulen
1373261 at bugs.launchpad.net
Thu Nov 6 15:32:44 UTC 2014
** Description changed:
- Reconfiguring between an IPv4-based and an IPv6-based MAAS_URL broke the
- ‘generator’ setting in my pserv.yaml: it ended up being the full IPv4
- netloc, with most of the IPv6 netloc tacked onto it.
+ Reconfiguring when the existing MAAS_URL used an IPv6 host address broke
+ the ‘generator’ setting in my pserv.yaml: it ended up being the full
+ newly configured netloc, with most of the previous IPv6 netloc tacked
+ onto it.
I think that's because the regex in maas-cluster-controller.postinst
mistakes the first colon in an IPv6 address for the beginning of a port
specifier:
- sed -i "s|MAAS_URL=.*|MAAS_URL=\"$RET\"|" /etc/maas/maas_cluster.conf
- # Extract the hostname part.
- HOSTPART=$(echo $RET|awk '{ split($0,array,"/")} END{print array[3] }')
- # And substitute it in-place in pserv.yaml on an indented, non-commented
- # line.
- sed -ri "s|^([[:space:]]+)(#+[[:space:]]*)?(generator:[[:space:]]+https?://)[^:/]+|\1\3$HOSTPART|" /etc/maas/pserv.yaml
+ sed -i "s|MAAS_URL=.*|MAAS_URL=\"$RET\"|" /etc/maas/maas_cluster.conf
+ # Extract the hostname part.
+ HOSTPART=$(echo $RET|awk '{ split($0,array,"/")} END{print array[3] }')
+ # And substitute it in-place in pserv.yaml on an indented, non-commented
+ # line.
+ sed -ri "s|^([[:space:]]+)(#+[[:space:]]*)?(generator:[[:space:]]+https?://)[^:/]+|\1\3$HOSTPART|" /etc/maas/pserv.yaml
These things are still best done in Python I suppose.
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to maas in Ubuntu.
https://bugs.launchpad.net/bugs/1373261
Title:
pserv.yaml rewrite breaks when MAAS URL uses IPv6 address
To manage notifications about this bug go to:
https://bugs.launchpad.net/maas/+bug/1373261/+subscriptions
More information about the Ubuntu-server-bugs
mailing list