Skip to content

Commit

Permalink
Allow nil parent for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooli Tayer committed Jul 25, 2017
1 parent 5ad91c9 commit 08bd58f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module ManageIQ::Providers::Kubernetes::MonitoringManagerMixin
included do
delegate :authentications,
:endpoints,
:to => :parent_manager
:to => :parent_manager,
:allow_nil => true

default_value_for :port do |manager|
manager.port || DEFAULT_PORT
Expand All @@ -19,7 +20,7 @@ def raw_connect(hostname, port, options)
end

def default_endpoint
endpoints.detect { |x| x.role == ENDPOINT_ROLE.to_s }
endpoints && endpoints.detect { |x| x.role == ENDPOINT_ROLE.to_s }
end

def supports_port?
Expand Down

0 comments on commit 08bd58f

Please sign in to comment.