2013-03-03 05:24:05 +00:00
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
module Action
|
2013-03-04 04:09:12 +00:00
|
|
|
# DISCUSS: The Boot action has a different meaning on VB provider and it
|
|
|
|
# assumes the machine has been started already.
|
2013-03-03 05:24:05 +00:00
|
|
|
class Boot < BaseAction
|
|
|
|
def call(env)
|
2013-03-03 07:37:07 +00:00
|
|
|
config = env[:machine].provider_config
|
2013-03-04 04:09:12 +00:00
|
|
|
|
|
|
|
# Allows this middleware to be called multiple times. We need to
|
|
|
|
# support this as base boxes might have after create scripts which
|
|
|
|
# require SSH access
|
|
|
|
unless env[:machine].state.running?
|
|
|
|
env[:machine].provider.container.start(config)
|
|
|
|
end
|
|
|
|
|
2013-03-03 05:24:05 +00:00
|
|
|
@app.call env
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|