Skip to content

Commit

Permalink
Merge pull request #2122 from allmightyspiff/issues2078
Browse files Browse the repository at this point in the history
Marked --crt and --key as required for slcli ssl add
  • Loading branch information
allmightyspiff authored Jan 2, 2024
2 parents 3e8bd0e + bb52241 commit 16d18f2
Showing 1 changed file with 8 additions and 14 deletions.
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

0 comments on commit 16d18f2

Please sign in to comment.