← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~julian-edwards/maas/cluster-pserv-address-bug-1081212 into lp:~maas-maintainers/maas/packaging

 

Julian Edwards has proposed merging lp:~julian-edwards/maas/cluster-pserv-address-bug-1081212 into lp:~maas-maintainers/maas/packaging.

Commit message:
  * debian/maas-cluster-controller.postinst: Ensure that /etc/maas/pserv.yaml
    is updated when reconfiguring. (LP: #1081212)


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1081212 in maas (Ubuntu): "The address of the API in pserv.conf (tftp/generator) is http://localhost/MAAS/api/1.0/pxeconfig/";
  https://bugs.launchpad.net/ubuntu/+source/maas/+bug/1081212

For more details, see:
https://code.launchpad.net/~julian-edwards/maas/cluster-pserv-address-bug-1081212/+merge/135572
-- 
https://code.launchpad.net/~julian-edwards/maas/cluster-pserv-address-bug-1081212/+merge/135572
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/maas/cluster-pserv-address-bug-1081212 into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/changelog'
--- debian/changelog	2012-11-13 20:40:07 +0000
+++ debian/changelog	2012-11-22 02:40:27 +0000
@@ -12,6 +12,8 @@
   * debian/maas-region-controller.install: Remove installation of maas-gc; it
     is no longer required as upstream no longer stores files in the filesystem.
     (LP: #1069734)
+  * debian/maas-cluster-controller.postinst: Ensure that /etc/maas/pserv.yaml
+    is updated when reconfiguring. (LP: #1081212)
 
   [ Jeroen Vermeulen ]
   * debian/maas-cluster-controller.install: Install import scripts.
@@ -36,7 +38,7 @@
     it doesn't contain it. This helps upgrades from versions where DEFAULT_MAAS_URL
     didn't use /MAAS.
 
- -- Julian Edwards <julian.edwards@xxxxxxxxxxxxx>  Fri, 26 Oct 2012 12:50:20 +0200
+ -- Julian Edwards <julian.edwards@xxxxxxxxxxxxx>  The, 22 Nov 2012 12:38:30 +0100
 
 maas (0.1+bzr1269+dfsg-0ubuntu1) quantal-proposed; urgency=low
 

=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst	2012-11-06 16:41:05 +0000
+++ debian/maas-cluster-controller.postinst	2012-11-22 02:40:27 +0000
@@ -51,10 +51,15 @@
         create_log_dir
     fi
 
-    # Get the MAAS_URL on configure/reconfigure and write it to the conf file.
+    # Get the MAAS_URL on configure/reconfigure and write it to the conf files.
     db_get maas-cluster-controller/maas-url || true
     if [ -n "$RET" ]; then
         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.conf on an indented, non-commented
+        # line.
+        sed -ri "s|^[[:space:]]+generator:[[:space:]]+http://.*:|  generator: http://"$HOSTPART":|" /etc/maas/pserv.conf
     fi
 fi