Skip to content

Commit 16d18f2

Browse files
Merge pull request #2122 from allmightyspiff/issues2078
Marked --crt and --key as required for slcli ssl add
2 parents 3e8bd0e + bb52241 commit 16d18f2

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

Diff for: SoftLayer/CLI/security/cert_add.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@
88

99

1010
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
11-
@click.option('--crt',
12-
type=click.Path(exists=True),
13-
help="Certificate file")
14-
@click.option('--csr',
15-
type=click.Path(exists=True),
16-
help="Certificate Signing Request file")
17-
@click.option('--icc',
18-
type=click.Path(exists=True),
19-
help="Intermediate Certificate file")
20-
@click.option('--key', type=click.Path(exists=True), help="Private Key file")
11+
@click.option('--crt', required=True, type=click.Path(exists=True), help="Certificate file")
12+
@click.option('--key', type=click.Path(exists=True), required=True, help="Private Key file")
13+
@click.option('--csr', type=click.Path(exists=True), help="Certificate Signing Request file")
14+
@click.option('--icc', type=click.Path(exists=True), help="Intermediate Certificate file")
2115
@click.option('--notes', help="Additional notes")
2216
@environment.pass_env
2317
def cli(env, crt, csr, icc, key, notes):
@@ -32,13 +26,13 @@ def cli(env, crt, csr, icc, key, notes):
3226
template['certificate'] = file_crt.read()
3327
with open(key, encoding="utf-8") as file_key:
3428
template['privateKey'] = file_key.read()
35-
with open(csr, encoding="utf-8") as file_csr:
36-
if csr:
29+
if csr:
30+
with open(csr, encoding="utf-8") as file_csr:
3731
body = file_csr.read()
3832
template['certificateSigningRequest'] = body
3933

40-
with open(icc, encoding="utf-8") as file_icc:
41-
if icc:
34+
if icc:
35+
with open(icc, encoding="utf-8") as file_icc:
4236
body = file_icc.read()
4337
template['intermediateCertificate'] = body
4438

0 commit comments

Comments
 (0)