8
8
9
9
10
10
@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" )
21
15
@click .option ('--notes' , help = "Additional notes" )
22
16
@environment .pass_env
23
17
def cli (env , crt , csr , icc , key , notes ):
@@ -32,13 +26,13 @@ def cli(env, crt, csr, icc, key, notes):
32
26
template ['certificate' ] = file_crt .read ()
33
27
with open (key , encoding = "utf-8" ) as file_key :
34
28
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 :
37
31
body = file_csr .read ()
38
32
template ['certificateSigningRequest' ] = body
39
33
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 :
42
36
body = file_icc .read ()
43
37
template ['intermediateCertificate' ] = body
44
38
0 commit comments