Skip to content

Commit

Permalink
Merge pull request #16405 from Ladas/log_less_details_about_the_targets
Browse files Browse the repository at this point in the history
Log less details about the targets
(cherry picked from commit 98d5ff6)
  • Loading branch information
agrare authored and simaishi committed Nov 7, 2017
1 parent b1913ed commit 41d1642
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/models/manager_refresh/target_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def add_target(association:, manager_ref:, manager: nil, manager_id: nil, event_
:options => options)
end

# @return [String] A String containing a name of each target in the TargetCollection
# @return [String] A String containing a summary
def name
"Collection of targets with name: #{targets.collect(&:name)}"
"Collection of #{targets.size} targets"
end

# @return [String] A String containing an id of each target in the TargetCollection
def id
"Collection of targets with id: #{targets.collect(&:id)}"
"Collection of targets with id: #{targets.collect(&:manager_ref)}"
end

# Returns targets in a format:
Expand Down
3 changes: 2 additions & 1 deletion spec/models/manager_refresh/target_collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
:options => {:opt1 => "opt1", :opt2 => "opt2"}
)

expect(target_collection.name).to eq "Collection of targets with name: [{:ems_ref=>\"vm_1\"}, {:ems_ref=>\"vm_2\"}]"
expect(target_collection.name).to eq "Collection of 2 targets"
expect(target_collection.id).to eq "Collection of targets with id: [{:ems_ref=>\"vm_1\"}, {:ems_ref=>\"vm_2\"}]"
end
end

Expand Down

0 comments on commit 41d1642

Please sign in to comment.