#NEWLINE# def get_task_associated_resource( self , task ) : #NEWLINE# #INDENT# if ( not task ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( task [ 'type' ] == 'TaskResource' ) : #NEWLINE# #INDENT# obj = self . _con . get ( task [ 'associatedResourceUri' ] ) #NEWLINE# tmp = { #NEWLINE# #INDENT# 'resourceName' : obj [ 'name' ] , #NEWLINE# 'associationType' : None , #NEWLINE# 'resourceCategory' : None , #NEWLINE# 'resourceUri' : obj [ 'uri' ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( task [ 'type' ] == 'TaskResourceV2' ) : #NEWLINE# #INDENT# tmp = task [ 'associatedResource' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise HPOneViewInvalidResource ( 'Task resource is not a recognized version' ) #NEWLINE# #UNINDENT# #UNINDENT# return tmp