#NEWLINE# def get_ephemerals( session , vm_ref ) : #NEWLINE# #INDENT# devices = [ ] #NEWLINE# hardware_devices = session . _call_method ( vutil , 'get_object_property' , vm_ref , 'config.hardware.device' ) #NEWLINE# if ( hardware_devices . __class__ . __name__ == 'ArrayOfVirtualDevice' ) : #NEWLINE# #INDENT# hardware_devices = hardware_devices . VirtualDevice #NEWLINE# #UNINDENT# for device in hardware_devices : #NEWLINE# #INDENT# if ( device . __class__ . __name__ == 'VirtualDisk' ) : #NEWLINE# #INDENT# if ( device . backing . __class__ . __name__ == 'VirtualDiskFlatVer2BackingInfo' ) : #NEWLINE# #INDENT# if ( 'ephemeral' in device . backing . fileName ) : #NEWLINE# #INDENT# devices . append ( device ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return devices