#NEWLINE# def to_dict( self ) : #NEWLINE# #INDENT# d = copy ( self . __dict__ ) #NEWLINE# to_remove = ( [ 'ext_loader' , 'workload_specs' ] + [ k for k in d . keys ( ) if k . startswith ( '_' ) ] ) #NEWLINE# for attr in to_remove : #NEWLINE# #INDENT# del d [ attr ] #NEWLINE# #UNINDENT# d [ 'workload_specs' ] = [ s . to_dict ( ) for s in self . workload_specs ] #NEWLINE# d [ 'reboot_policy' ] = self . reboot_policy #NEWLINE# return s