Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marked --crt and --key as required for slcli ssl add #2122

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions SoftLayer/CLI/security/cert_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@


@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@click.option('--crt',
type=click.Path(exists=True),
help="Certificate file")
@click.option('--csr',
type=click.Path(exists=True),
help="Certificate Signing Request file")
@click.option('--icc',
type=click.Path(exists=True),
help="Intermediate Certificate file")
@click.option('--key', type=click.Path(exists=True), help="Private Key file")
@click.option('--crt', required=True, type=click.Path(exists=True), help="Certificate file")
@click.option('--key', type=click.Path(exists=True), required=True, help="Private Key file")
@click.option('--csr', type=click.Path(exists=True), help="Certificate Signing Request file")
@click.option('--icc', type=click.Path(exists=True), help="Intermediate Certificate file")
@click.option('--notes', help="Additional notes")
@environment.pass_env
def cli(env, crt, csr, icc, key, notes):
Expand All @@ -32,13 +26,13 @@ def cli(env, crt, csr, icc, key, notes):
template['certificate'] = file_crt.read()
with open(key, encoding="utf-8") as file_key:
template['privateKey'] = file_key.read()
with open(csr, encoding="utf-8") as file_csr:
if csr:
if csr:
with open(csr, encoding="utf-8") as file_csr:
body = file_csr.read()
template['certificateSigningRequest'] = body

with open(icc, encoding="utf-8") as file_icc:
if icc:
if icc:
with open(icc, encoding="utf-8") as file_icc:
body = file_icc.read()
template['intermediateCertificate'] = body

Expand Down