#NEWLINE# @ classmethod #NEWLINE# def set_volumes( cls , node , volumes ) : #NEWLINE# #INDENT# 'Sets volumes\n\n        :param node: node object\n        :param volumes: volumes for node\n        :returns: volumes\n        ' #NEWLINE# node = NailgunNodeAdapter ( node ) #NEWLINE# volume_db = cls . _get_model_by_node_id ( node . id ) #NEWLINE# if volume_db : #NEWLINE# #INDENT# volume_db . volumes = deepcopy ( volumes ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# volumes = NodeVolumes ( node_id = node . id , volumes = volumes ) #NEWLINE# db ( ) . add ( volumes ) #NEWLINE# #UNINDENT# db ( ) . flush ( ) #NEWLINE# return volume_db