mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
puppet: suppress puppet warnings with ruby 2.7.
Ubuntu Focal comes with ruby 2.7 and the latest puppet has some issues with it so to suppress puppet warnings with ruby 2.7 we added RUBYOPT = "-W0" in the environment.
This commit is contained in:
@@ -20,8 +20,8 @@ if len(extra_args) and extra_args[0] in ('-f', '--force'):
|
||||
config = configparser.RawConfigParser()
|
||||
config.read("/etc/zulip/zulip.conf")
|
||||
|
||||
distro_info = parse_os_release()
|
||||
if not os.path.exists("/etc/puppet/hiera.yaml"):
|
||||
distro_info = parse_os_release()
|
||||
if (distro_info['ID'], distro_info['VERSION_ID']) in [('debian', '9'), ('ubuntu', '16.04')]:
|
||||
# Suppress warnings in old puppet about hiera.yaml not existing.
|
||||
open("/etc/puppet/hiera.yaml", "a").close()
|
||||
@@ -43,6 +43,10 @@ puppet_cmd += extra_args
|
||||
puppet_env = os.environ.copy()
|
||||
puppet_env["FACTER_zulip_scripts_path"] = scripts_path
|
||||
|
||||
# This is to suppress puppet warnings with ruby 2.7.
|
||||
if (distro_info['ID'], distro_info['VERSION_ID']) in [('ubuntu', '20.04')]:
|
||||
puppet_env["RUBYOPT"] = "-W0"
|
||||
|
||||
if not force:
|
||||
subprocess.check_call(puppet_cmd + ['--noop', '--show_diff'], env=puppet_env)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user