@require_role('admin')
def asset_update(request):
 asset_id = request.GET.get('id', '')
 asset = get_object(Asset, id=asset_id)
 name = request.user.username
 if (not asset):
  return HttpResponseRedirect((reverse('asset_detail') + ('?id=%s' % asset_id)))
 else:
  asset_ansible_update([asset], name)
 return HttpResponseRedirect((reverse('asset_detail') + ('?id=%s' % asset_id)))

@ require_role ( 'admin' ) def asset_update ( request ) : asset_id = request . GET . get ( 'id' , '' ) asset = get_object ( Asset , id = asset_id ) name = request . user . username if ( not asset ) : return HttpResponseRedirect ( ( reverse ( 'asset_detail' ) + ( '?id=%s' % asset_id ) ) ) else : asset_ansible_update ( [ asset ] , name ) return HttpResponseRedirect ( ( reverse ( 'asset_detail' ) + ( '?id=%s' % asset_id ) ) )
asset update host info via ansible view .