2013-04-10 05:02:36 +00:00
|
|
|
require_relative 'fetch_ip_with_attach'
|
|
|
|
require_relative 'fetch_ip_from_dnsmasq'
|
|
|
|
|
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
class Driver
|
|
|
|
class Builder
|
2013-07-28 05:17:05 +00:00
|
|
|
def self.build(id, shell)
|
|
|
|
version = CLI.new(shell).version.match(/^(\d+\.\d+)\./)[1].to_f
|
|
|
|
Driver.new(id, shell).tap do |driver|
|
2013-04-10 05:02:36 +00:00
|
|
|
mod = version >= 0.8 ?
|
|
|
|
Driver::FetchIpWithAttach :
|
|
|
|
Driver::FetchIpFromDsnmasq
|
|
|
|
|
|
|
|
driver.extend(mod)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|