mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
puppet: Catch when a comma is left out of puppet_classes.
With two space-separated classes in `puppet_classes`, the second one is silently ignored. With three of more, puppet generates the following very opaque error message: ``` Error: Could not parse for environment production: This Name has no effect. A value was produced and then forgotten (one or more preceding expressions may have the wrong form) ``` Catch when this has happened, and give an error message to the user. Fixes #18992.
This commit is contained in:
@@ -31,6 +31,11 @@ Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" }
|
||||
"""
|
||||
|
||||
for pclass in re.split(r"\s*,\s*", config.get("machine", "puppet_classes")):
|
||||
if " " in pclass:
|
||||
print(
|
||||
f"The `machine.puppet_classes` setting in {args.config} must be comma-separated, not space-separated!"
|
||||
)
|
||||
sys.exit(1)
|
||||
puppet_config += f"include {pclass}\n"
|
||||
|
||||
# We use the Puppet configuration from the same Zulip checkout as this script
|
||||
|
Reference in New Issue
Block a user