#NEWLINE# def do_get_config_profile( self , line ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# cfgp_list = self . dcnm_client . config_profile_list ( ) #NEWLINE# if ( not cfgp_list ) : #NEWLINE# #INDENT# print ( 'No config profile found.' ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# except dexc . DfaClientRequestFailed : #NEWLINE# #INDENT# print ( 'Failed to access DCNM.' ) #NEWLINE# return #NEWLINE# #UNINDENT# cfg_table = PrettyTable ( [ 'Config Profile Name' , 'Alias' ] ) #NEWLINE# for cfg in cfgp_list : #NEWLINE# #INDENT# if cfg . startswith ( 'defaultNetwork' ) : #NEWLINE# #INDENT# cfg_alias = cfg . split ( 'defaultNetwork' ) [ 1 ] . split ( 'Profile' ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if cfg . endswith ( 'Profile' ) : #NEWLINE# #INDENT# cfg_alias = cfg . split ( 'Profile' ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cfg_alias = cfg #NEWLINE# #UNINDENT# #UNINDENT# cfg_table . add_row ( [ cfg , cfg_alias ] ) #NEWLINE# #UNINDENT# print ( cfg_table )