Fix: Allow Pegleg to generate unencrypted bundle
Promenade supports generating a bundle with or without encryption Pegleg currently does not, it requires encryption. This patch changes Pegleg behavior to look for an encryption method and key before generating a bundle. 1. If both are present - generate with encryption 2. If neither are present - generate without encryption 3. If one or the other is present - raise an error Change-Id: Id55e310ced3d650f64d3f6f626faa10dbe3ab052
This commit is contained in:
parent
ccd05998b2
commit
55349d078e
|
@ -73,10 +73,15 @@ def build_genesis(build_path, encryption_key, validators, debug, site_name):
|
||||||
substitute=True,
|
substitute=True,
|
||||||
allow_missing_substitutions=False,
|
allow_missing_substitutions=False,
|
||||||
leave_kubectl=False)
|
leave_kubectl=False)
|
||||||
|
# Both a policy and key are present, generate bundle with encryption
|
||||||
if c.get_path('EncryptionPolicy:scripts.genesis') and encryption_key:
|
if c.get_path('EncryptionPolicy:scripts.genesis') and encryption_key:
|
||||||
Builder(c, validators=validators).build_all(output_dir=build_path)
|
Builder(c, validators=validators).build_all(output_dir=build_path)
|
||||||
else:
|
# A policy or key are present but not both, raise an error
|
||||||
|
elif c.get_path('EncryptionPolicy:scripts.genesis') or encryption_key:
|
||||||
raise GenesisBundleEncryptionException()
|
raise GenesisBundleEncryptionException()
|
||||||
|
# Neither policy or key are present, generate bundle without encryption
|
||||||
|
else:
|
||||||
|
Builder(c, validators=validators).build_all(output_dir=build_path)
|
||||||
|
|
||||||
except exceptions.PromenadeException as e:
|
except exceptions.PromenadeException as e:
|
||||||
LOG.error(
|
LOG.error(
|
||||||
|
|
Loading…
Reference in New Issue