Chapter 09/circuit-oneops-1-master/components/cookbooks/f5-bigip/libraries/loader.rb
#
# Retrieve/Create load balancer from list of load balancers for a resource
#
# @return [F5::LoadBalancer] instance of F5::LoadBalancer matching the resource
#
Retrieve/Create load balancer from list of load balancers for a resource
Retrieve / Create load balancer from list of load balancers for a resource
def load_balancer
      fail 'Can not determine hostname to load client for' if @new_resource.f5.nil?
      @@load_balancers ||= []
      add_lb(@new_resource.f5) if @@load_balancers.empty?
      add_lb(@new_resource.f5) if @@load_balancers.find { |lb| lb.name == @new_resource.f5 }.nil?
      @@load_balancers.find { |lb| lb.name == @new_resource.f5 }
    end
def load_balancer fail 'Can not determine hostname to load client for' if @new_resource . f5 . nil? @@load_balancers ||= [ ] add_lb ( @new_resource . f5 ) if @@load_balancers . empty? add_lb ( @new_resource . f5 ) if @@load_balancers . find { | lb | lb . name == @new_resource . f5 } . nil? @@load_balancers . find { | lb | lb . name == @new_resource . f5 } end
Retrieve/Create load balancer from list of load balancers for a resource
Retrieve / Create load balancer from list of load balancers for a resource
instance of F5::LoadBalancer matching the resource
instance of F5 :: LoadBalancer matching the resource
F5::LoadBalancer