Remove duplicate flags as options

Multiple occurences of -p or -f in the same command is vague.
Removing duplicate shorthand flags in favor of the explicit long form
flags instead for several commands.

Change-Id: Ic26360e517ea8f7ad2e0e5354d34a61fd622e0f1
This commit is contained in:
Hughes, Alexander (ah8742) 2019-06-07 18:12:28 +00:00
parent 4d3e9d171b
commit 489e641702
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 the site and global repositories are used, as specified in the site's
:file:`site-definition.yaml`. :file:`site-definition.yaml`.
**-p / --path** (Required). **--path** (Required).
Path to pegleg managed encrypted secrets file or directory of files. 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>] [-s <output_path>]
Examples Examples
@ -735,7 +735,7 @@ for tracking provenance information in the PeglegManagedDocuments.
An attempt is made to automatically determine this value, An attempt is made to automatically determine this value,
but should be provided. but should be provided.
**-f / --filename** **--filename**
The relative path to the file to be wrapped. The relative path to the file to be wrapped.
@ -766,7 +766,7 @@ Examples
:: ::
./pegleg.sh site -r /home/myuser/myrepo \ ./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" \ -o secrets/certificates/new_cert.yaml -s "deckhand/Certificate/v1" \
-n "new-cert" -l site mysite -n "new-cert" -l site mysite

View File

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

View File

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