Merge "Remove duplicate flags as options"

This commit is contained in:
Zuul 2019-06-18 21:06:04 +00:00 committed by Gerrit Code Review
commit ed478162ca
3 changed files with 8 additions and 10 deletions

View File

@ -685,7 +685,7 @@ repository folder structure. This is used to ensure the correct revision of
the site and global repositories are used, as specified in the site's
:file:`site-definition.yaml`.
**-p / --path** (Required).
**--path** (Required).
Path to pegleg managed encrypted secrets file or directory of files.
@ -703,7 +703,7 @@ Usage:
::
./pegleg.sh site <options> secrets decrypt <site_name> -p <path>
./pegleg.sh site <options> secrets decrypt <site_name> --path <path>
[-s <output_path>]
Examples
@ -735,7 +735,7 @@ for tracking provenance information in the PeglegManagedDocuments.
An attempt is made to automatically determine this value,
but should be provided.
**-f / --filename**
**--filename**
The relative path to the file to be wrapped.
@ -766,7 +766,7 @@ Examples
::
./pegleg.sh site -r /home/myuser/myrepo \
secrets wrap -a myuser -f secrets/certificates/new_cert.crt \
secrets wrap -a myuser --filename secrets/certificates/new_cert.crt \
-o secrets/certificates/new_cert.yaml -s "deckhand/Certificate/v1" \
-n "new-cert" -l site mysite

View File

@ -477,7 +477,6 @@ def generate_pki(site_name, author, days):
'author',
help='Author for the new wrapped file.')
@click.option(
'-f',
'--filename',
'filename',
help='The relative file path for the file to be wrapped.')
@ -703,7 +702,6 @@ def encrypt(*, save_location, author, site_name):
help='Command to unwrap and decrypt one site '
'secrets document and print it to stdout.')
@click.option(
'-p',
'--path',
'path',
type=click.Path(exists=True, readable=True),

View File

@ -572,7 +572,7 @@ class TestSiteSecretsActions(BaseCLIActionTest):
assert "encrypted" in ceph_fsid["data"]
assert "managedDocument" in ceph_fsid["data"]
secrets_opts = ['secrets', 'decrypt', '-p', file_path,
secrets_opts = ['secrets', 'decrypt', '--path', file_path,
self.site_name]
result = self.runner.invoke(cli.site, ['-r', repo_path] + secrets_opts)
assert result.exit_code == 0, result.output
@ -604,8 +604,8 @@ class TestSiteSecretsActions(BaseCLIActionTest):
with open(file_path, "w") as test_crt_fi:
test_crt_fi.write(test_cert)
secrets_opts = ['secrets', 'wrap', "-a", "lm734y", "-f", file_path,
"-s", "deckhand/Certificate/v1",
secrets_opts = ['secrets', 'wrap', "-a", "lm734y", "--filename",
file_path, "-s", "deckhand/Certificate/v1",
"-n", "test-certificate", "-l", "site", "--no-encrypt",
self.site_name]
result = self.runner.invoke(cli.site, ["-r", repo_path] + secrets_opts)
@ -620,7 +620,7 @@ class TestSiteSecretsActions(BaseCLIActionTest):
assert doc["data"]["managedDocument"]["metadata"]["storagePolicy"] == "cleartext"
os.remove(output_path)
secrets_opts = ['secrets', 'wrap', "-a", "lm734y", "-f", file_path,
secrets_opts = ['secrets', 'wrap', "-a", "lm734y", "--filename", file_path,
"-o", output_path, "-s", "deckhand/Certificate/v1",
"-n", "test-certificate", "-l", "site",
self.site_name]