Merge "Strip by default in tools/encrypt_secret"
This commit is contained in:
commit
48e00cdfb1
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
upgrade:
|
||||
- |
|
||||
The default behavior of the ``tools/encrypt_secret.py``
|
||||
helper script is now to strip incoming input of leading
|
||||
and trailing whitespace. A new ``--no-strip`` option
|
||||
has been added to support people with secrets that contain
|
||||
valid leading or trailing whitespace.
|
|
@ -56,8 +56,11 @@ def main():
|
|||
default=None,
|
||||
help="The name of the Zuul tenant. This may be "
|
||||
"required in a multi-tenant environment.")
|
||||
parser.add_argument('--strip', action='store_true', default=False,
|
||||
help="Strip whitespace from beginning/end of input.")
|
||||
parser.add_argument('--strip', default=None,
|
||||
help='Unused, kept for backward compatibility.')
|
||||
parser.add_argument('--no-strip', action='store_true', default=False,
|
||||
help="Do not strip whitespace from beginning or "
|
||||
"end of input.")
|
||||
parser.add_argument('--infile',
|
||||
default=None,
|
||||
help="A filename whose contents will be encrypted. "
|
||||
|
@ -119,7 +122,7 @@ def main():
|
|||
plaintext = sys.stdin.read()
|
||||
|
||||
plaintext = plaintext.encode("utf-8")
|
||||
if args.strip:
|
||||
if not args.no_strip:
|
||||
plaintext = plaintext.strip()
|
||||
|
||||
pubkey_file = tempfile.NamedTemporaryFile(delete=False)
|
||||
|
|
Loading…
Reference in New Issue