From 2332113c9761621d3f3ee5d02aa186c99cb34530 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 28 Oct 2020 14:30:59 -0700 Subject: [PATCH] upgrade: Adjust puppet class names even with --skip-puppet. The class names need to be renamed even if we are not about to run puppet ourselves; otherwise, deployments which rely on running puppet themselves will still have the wrong class names. --- scripts/lib/upgrade-zulip-stage-2 | 35 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 5579c2ce25..8ffed6539a 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -256,24 +256,25 @@ if (not args.skip_puppet or migrations_needed) and IS_SERVER_UP: # state. shutdown_server() -if not args.skip_puppet: - # Adjust Puppet class names for the rename after 3.x - class_renames = { - 'zulip::app_frontend': 'zulip::profile::app_frontend', - 'zulip::dockervoyager': 'zulip::profile::docker', - 'zulip::memcached': 'zulip::profile::memcached', - 'zulip::postgres_appdb_tuned': 'zulip::profile::postgresql', - 'zulip::rabbit': 'zulip::profile::rabbitmq', - 'zulip::thumbor': 'zulip::profile::thumbor', - 'zulip::voyager': 'zulip::profile::standalone', - } - classes = re.split(r'\s*,\s*', get_config(config_file, 'machine', 'puppet_classes')) - new_classes = [class_renames.get(c, c) for c in classes if c != 'zulip::base'] - if classes != new_classes: - logging.info("Adjusting Puppet classes for renames...") - subprocess.check_call(["crudini", "--set", "/etc/zulip/zulip.conf", - "machine", "puppet_classes", ", ".join(new_classes)]) +# Adjust Puppet class names for the rename after 3.x +class_renames = { + 'zulip::app_frontend': 'zulip::profile::app_frontend', + 'zulip::dockervoyager': 'zulip::profile::docker', + 'zulip::memcached': 'zulip::profile::memcached', + 'zulip::postgres_appdb_tuned': 'zulip::profile::postgresql', + 'zulip::rabbit': 'zulip::profile::rabbitmq', + 'zulip::thumbor': 'zulip::profile::thumbor', + 'zulip::voyager': 'zulip::profile::standalone', +} +classes = re.split(r'\s*,\s*', get_config(config_file, 'machine', 'puppet_classes')) +new_classes = [class_renames.get(c, c) for c in classes if c != 'zulip::base'] +if classes != new_classes: + logging.info("Adjusting Puppet classes for renames...") + subprocess.check_call(["crudini", "--set", "/etc/zulip/zulip.conf", + "machine", "puppet_classes", ", ".join(new_classes)]) + +if not args.skip_puppet: logging.info("Applying Puppet changes...") subprocess.check_call(["./scripts/zulip-puppet-apply", "--force"]) subprocess.check_call(["apt-get", "-y", "upgrade"])