launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #14790
[Merge] lp:~jtv/maas/pkg-bug-1089508 into lp:~maas-maintainers/maas/packaging
Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/pkg-bug-1089508 into lp:~maas-maintainers/maas/packaging.
Commit message:
Make sure cluster upgrade deals well with single-quoted cluster uuid.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1089508 in MAAS: "Cluster upgrade may have trouble with single-quoted CLUSTER_UUID"
https://bugs.launchpad.net/maas/+bug/1089508
For more details, see:
https://code.launchpad.net/~jtv/maas/pkg-bug-1089508/+merge/139527
Scott points out that the postinst script for maas-cluster-controller, when migrating an old-style CLUSTER_UUID setting in the celery config into maas_cluster.conf, doesn't appear to cope with single-quoted uuids as it was intended to.
The potential problem was not actually observed in manual upgrade testing. We may have switched from double quotes to single quotes at some point, in which case the particular version I tested against may have happened to hide the problem.
Also as per Scott's suggestion, this branch uses sed's don't-print-every-line option to obviate the "grep" invocation for filtering. A "p" (print) after the "s" (substitute) command makes sure just the matching line gets printed.
I tested this by installing, uninstalling, manually removing the CLUSTER_UUID setting from maas_cluster.conf to simulate an old install, verifying that the version in the celery config was single-quoted, re-installing, and verifying that the values are once again in both config files, and sane in both cases.
Jeroen
--
https://code.launchpad.net/~jtv/maas/pkg-bug-1089508/+merge/139527
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/pkg-bug-1089508 into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst 2012-12-11 07:26:33 +0000
+++ debian/maas-cluster-controller.postinst 2012-12-12 17:51:21 +0000
@@ -30,9 +30,7 @@
# Extract ClUSTER_UUID setting from config file $1. This will work
# both the cluster celery config (which is python) and the cluster
# config (which is shell).
- local config_file="$1"
- grep "^CLUSTER_UUID *= *[\"'][^\"']*[\"']" $config_file |
- sed -e "s/^CLUSTER_UUID *= *\"\([^\"']*\)\".*/\1/"
+ sed -n -e "s/^CLUSTER_UUID *= *[\"']\([^\"']*\).*/\1/p" "$1"
}
configure_cluster_uuid(){
Follow ups