@utils.expects_func_args('self', 'spec_obj')
def set_update_time_on_success(function):
 @functools.wraps(function)
 def decorated_function(self, spec_obj):
  return_value = None
  try:
   return_value = function(self, spec_obj)
  except Exception as e:
   LOG.warning(_LW('Selected host: %(host)s failed to consume from instance. Error: %(error)s'), {'host': self.host, 'error': e})
  else:
   now = timeutils.utcnow()
   self.updated = now.replace(tzinfo=iso8601.iso8601.Utc())
  return return_value
 return decorated_function

@ utils . expects_func_args ( 'self' , 'spec_obj' ) def set_update_time_on_success ( function ) : @ functools . wraps ( function ) def decorated_function ( self , spec_obj ) : return_value = None try : return_value = function ( self , spec_obj ) except Exception as e : LOG . warning ( _LW ( 'Selected host: %(host)s failed to consume from instance. Error: %(error)s' ) , { 'host' : self . host , 'error' : e } ) else : now = timeutils . utcnow ( ) self . updated = now . replace ( tzinfo = iso8601 . iso8601 . Utc ( ) ) return return_value return decorated_function
set updated time of hoststate when consuming succeed .