From af34984e1e8038b83a9dbbf8b965972a81126c0f Mon Sep 17 00:00:00 2001 From: nimrodshn Date: Mon, 9 Apr 2018 18:55:30 +0300 Subject: [PATCH] adding scan action with userid to miq_schedule propagate userid appease linter adding userid param to EmsCluster#scan and ContainerImage#scan appeasing linter --- app/models/container_image.rb | 4 ++-- app/models/ems_cluster.rb | 2 +- app/models/miq_schedule.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/container_image.rb b/app/models/container_image.rb index c8b78f83bbf..053cd99f3d0 100644 --- a/app/models/container_image.rb +++ b/app/models/container_image.rb @@ -66,8 +66,8 @@ def display_registry container_image_registry.present? ? container_image_registry.full_name : _("Unknown image source") end - def scan - ext_management_system.scan_job_create(self) + def scan(userid = "system") + ext_management_system.scan_job_create(self, userid) end def perform_metadata_scan(ost) diff --git a/app/models/ems_cluster.rb b/app/models/ems_cluster.rb index c7a9eb6b4f6..04632412f95 100644 --- a/app/models/ems_cluster.rb +++ b/app/models/ems_cluster.rb @@ -209,7 +209,7 @@ def ems_events EmsEvent.where(ewc).order("timestamp").to_a end - def scan + def scan(_userid = "system") MiqQueue.submit_job( :service => "smartstate", :affinity => ext_management_system, diff --git a/app/models/miq_schedule.rb b/app/models/miq_schedule.rb index dc5ba2c4e6d..7eb75fefffb 100644 --- a/app/models/miq_schedule.rb +++ b/app/models/miq_schedule.rb @@ -192,7 +192,7 @@ def action_vm_scan(obj, _at) def action_scan(obj, _at) sched_action[:options] ||= {} - obj.scan + obj.scan(userid) _log.info("Action [#{name}] has been run for target type: [#{obj.class}] with name: [#{obj.name}]") end