class Bosh::Director::DeploymentPlan::PlannerLinkLookup
Used to find link source from deployment plan
Public Class Methods
new(consumed_link, link_path, deployment_plan, link_network)
click to toggle source
# File lib/bosh/director/deployment_plan/links/link_lookup.rb, line 24 def initialize(consumed_link, link_path, deployment_plan, link_network) @consumed_link = consumed_link @link_path = link_path @jobs = deployment_plan.instance_groups @link_network = link_network end
Public Instance Methods
find_link_spec()
click to toggle source
# File lib/bosh/director/deployment_plan/links/link_lookup.rb, line 31 def find_link_spec job = @jobs.find { |j| j.name == @link_path.job } return nil unless job template = job.templates.find { |t| t.name == @link_path.template } return nil unless template found = template.provided_links(job.name).find { |p| p.name == @link_path.name && p.type == @consumed_link.type } return nil unless found Link.new(@link_path.name, job, template, @link_network).spec end