← Back to team overview

launchpad-reviewers team mailing list archive

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

 

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

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


Requested reviews:
  MAAS Maintainers (maas-maintainers)
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/1.2-cluster-pserv-address-bug-1081212/+merge/135575
-- 
https://code.launchpad.net/~julian-edwards/maas/1.2-cluster-pserv-address-bug-1081212/+merge/135575
Your team MAAS Maintainers is requested to review the proposed merge of lp:~julian-edwards/maas/1.2-cluster-pserv-address-bug-1081212 into lp:~maas-maintainers/maas/packaging.quantal.
=== modified file 'debian/changelog'
--- debian/changelog	2012-11-21 01:18:06 +0000
+++ debian/changelog	2012-11-22 02:58:19 +0000
@@ -30,6 +30,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)
 
   [ Andres Rodriguez ]
   * debian/control:

=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst	2012-11-20 22:13:28 +0000
+++ debian/maas-cluster-controller.postinst	2012-11-22 02:58:19 +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
 


Follow ups