#NEWLINE# @ click . command ( ) #NEWLINE# @ click . argument ( 'identifier' ) #NEWLINE# @ click . option ( '--crt' , type = click . Path ( exists = True ) , help = 'Certificate file' ) #NEWLINE# @ click . option ( '--csr' , type = click . Path ( exists = True ) , help = 'Certificate Signing Request file' ) #NEWLINE# @ click . option ( '--icc' , type = click . Path ( exists = True ) , help = 'Intermediate Certificate file' ) #NEWLINE# @ click . option ( '--key' , type = click . Path ( exists = True ) , help = 'Private Key file' ) #NEWLINE# @ click . option ( '--notes' , help = 'Additional notes' ) #NEWLINE# @ environment . pass_env #NEWLINE# def cli( env , identifier , crt , csr , icc , key , notes ) : #NEWLINE# #INDENT# 'Edit SSL certificate.' #NEWLINE# template = { #NEWLINE# #INDENT# 'id' : identifier , #NEWLINE# #UNINDENT# } #NEWLINE# if crt : #NEWLINE# #INDENT# template [ 'certificate' ] = open ( crt ) . read ( ) #NEWLINE# #UNINDENT# if key : #NEWLINE# #INDENT# template [ 'privateKey' ] = open ( key ) . read ( ) #NEWLINE# #UNINDENT# if csr : #NEWLINE# #INDENT# template [ 'certificateSigningRequest' ] = open ( csr ) . read ( ) #NEWLINE# #UNINDENT# if icc : #NEWLINE# #INDENT# template [ 'intermediateCertificate' ] = open ( icc ) . read ( ) #NEWLINE# #UNINDENT# if template : #NEWLINE# #INDENT# template [ 'notes' ] = notes #NEWLINE# #UNINDENT# manager = SoftLayer . SSLManager ( env . client ) #NEWLINE# manager . edit_certificate ( template )