vagrant-lxc-ng/lib/vagrant-lxc/action/create.rb

22 lines
502 B
Ruby
Raw Normal View History

module Vagrant
module LXC
module Action
2013-04-02 00:05:19 +00:00
class Create
def initialize(app, env)
@app = app
end
def call(env)
base_name = env[:root_path].basename.to_s
base_name.gsub!(/[^-a-z0-9_]/i, "")
machine_id = env[:machine].provider.driver.create(base_name, env[:machine].box.metadata)
env[:machine].id = machine_id
env[:just_created] = true
@app.call env
end
end
end
end
end