def compute_node_utilization_set(context, host, free_ram_mb=None, free_disk_gb=None, work=None, vms=None):
 session = get_session()
 compute_node = None
 with session.begin(subtransactions=True):
  compute_node = session.query(models.ComputeNode).options(joinedload('service')).filter((models.Service.host == host)).filter_by(deleted=False).with_lockmode('update').first()
  if (compute_node is None):
   raise exception.NotFound((_('No ComputeNode for %(host)s') % locals()))
  if (free_ram_mb != None):
   compute_node.free_ram_mb = free_ram_mb
  if (free_disk_gb != None):
   compute_node.free_disk_gb = free_disk_gb
  if (work != None):
   compute_node.current_workload = work
  if (vms != None):
   compute_node.running_vms = vms
 return compute_node

def compute_node_utilization_set ( context , host , free_ram_mb = None , free_disk_gb = None , work = None , vms = None ) : session = get_session ( ) compute_node = None with session . begin ( subtransactions = True ) : compute_node = session . query ( models . ComputeNode ) . options ( joinedload ( 'service' ) ) . filter ( ( models . Service . host == host ) ) . filter_by ( deleted = False ) . with_lockmode ( 'update' ) . first ( ) if ( compute_node is None ) : raise exception . NotFound ( ( _ ( 'No ComputeNode for %(host)s' ) % locals ( ) ) ) if ( free_ram_mb != None ) : compute_node . free_ram_mb = free_ram_mb if ( free_disk_gb != None ) : compute_node . free_disk_gb = free_disk_gb if ( work != None ) : compute_node . current_workload = work if ( vms != None ) : compute_node . running_vms = vms return compute_node
like compute_node_utilization_update() modify a specific host entry .