Skip to content

Commit

Permalink
Fixes #17842 - Adds 'type = compute_resource' to Audit search
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomizadok committed Dec 25, 2016
1 parent 59e7136 commit 00eb0c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/audit_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module AuditExtensions
scoped_search :on => :auditable_type, :complete_value => { :host => 'Host', :parameter => 'Parameter', :architecture => 'Architecture',
:puppetclass => 'Puppetclass', :os => 'Operatingsystem', :hostgroup => 'Hostgroup',
:template => "ProvisioningTemplate", :lookupvalue => 'LookupValue',
:ssh_key => 'KeyPair'}, :rename => :type
:ssh_key => 'KeyPair', :compute_resource => 'ComputeResource'}, :rename => :type

scoped_search :relation => :search_parameters, :on => :name, :complete_value => true, :rename => :parameter, :only_explicit => true
scoped_search :relation => :search_templates, :on => :name, :complete_value => true, :rename => :template, :only_explicit => true
Expand Down
5 changes: 5 additions & 0 deletions test/models/concerns/audit_extensions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ def setup
FactoryGirl.create :lookup_value, :lookup_key_id => key.id, :value => false, :match => "hostgroup=Common"
refute_empty Audit.search_for("type = lookupvalue")
end

test "search for type=compute_resource in audit" do
FactoryGirl.create(:ec2_cr)
refute_empty Audit.search_for("type = compute_resource")
end
end

0 comments on commit 00eb0c8

Please sign in to comment.