Skip to content

Commit

Permalink
adding scan action with userid to miq_schedule
Browse files Browse the repository at this point in the history
propagate userid

appease linter
  • Loading branch information
nimrodshn committed Apr 10, 2018
1 parent cd1068f commit 3f45458
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/models/container_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def display_registry
end

def scan
ext_management_system.scan_job_create(self)
scan_with_userid(User.current_user.userid)
end

def scan_with_userid(userid)
ext_management_system.scan_job_create(self, userid)
end

def perform_metadata_scan(ost)
Expand Down
6 changes: 5 additions & 1 deletion app/models/miq_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ def action_vm_scan(obj, _at)

def action_scan(obj, _at)
sched_action[:options] ||= {}
obj.scan
if obj.respond_to?(:scan_with_userid)
obj.scan_with_userid(userid)
else
obj.scan
end
_log.info("Action [#{name}] has been run for target type: [#{obj.class}] with name: [#{obj.name}]")
end

Expand Down

0 comments on commit 3f45458

Please sign in to comment.