<s> import os . path <EOL> from magnumclient . common import cliutils as utils <EOL> def _show_cert ( certificate ) : <EOL> print ( certificate . pem ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> required = True , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def do_ca_show ( cs , args ) : <EOL> """<STR_LIT>""" <EOL> bay = cs . bays . get ( args . bay ) <EOL> opts = { <EOL> '<STR_LIT>' : bay . uuid <EOL> } <EOL> cert = cs . certificates . get ( ** opts ) <EOL> _show_cert ( cert ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> required = True , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def do_ca_sign ( cs , args ) : <EOL> """<STR_LIT>""" <EOL> bay = cs . bays . get ( args . bay ) <EOL> opts = { <EOL> '<STR_LIT>' : bay . uuid <EOL> } <EOL> if args . csr is None or not os . path . isfile ( args . csr ) : <EOL> print ( '<STR_LIT>' ) <EOL> return <EOL> with open ( args . csr , '<STR_LIT:r>' ) as f : <EOL> opts [ '<STR_LIT>' ] = f . read ( ) <EOL> cert = cs . certificates . create ( ** opts ) <EOL> _show_cert ( cert ) </s>
