Sha256: abccfb2ce9fd270db0570c3e3653be0252d46c3b8a306dd8e655c24bd4db8c59

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

module Vagrant
  module LXC
    module Action
      class Create
        def initialize(app, env)
          @app = app
        end

        def call(env)
          container_name = env[:root_path].basename.to_s
          container_name.gsub!(/[^-a-z0-9_]/i, "")
          container_name << "-#{Time.now.to_i}"

          env[:machine].provider.driver.create(
            container_name,
            env[:lxc_template_src],
            env[:lxc_template_config],
            env[:lxc_template_opts]
          )

          env[:machine].id = container_name

          @app.call env
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-lxc-0.4.0 lib/vagrant-lxc/action/create.rb