Module: ChefLxc::Resource

Included in:
Chef::Resource::LxcFile, Chef::Resource::LxcTemplate
Defined in:
lib/vagabond/cookbooks/lxc/libraries/lxc_expanded_resources.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/vagabond/cookbooks/lxc/libraries/lxc_expanded_resources.rb', line 19

def self.included(base)
  base.class_eval do
    def initialize(*args)
      super
      @container = nil
    end
  end
end

Instance Method Details

#container(arg = nil) ⇒ Object



4
5
6
# File 'lib/vagabond/cookbooks/lxc/libraries/lxc_expanded_resources.rb', line 4

def container(arg=nil)
  set_or_return(:container, arg, :kind_of => [String], :required => true)
end

#lxcObject



8
9
10
11
12
13
# File 'lib/vagabond/cookbooks/lxc/libraries/lxc_expanded_resources.rb', line 8

def lxc
  @lxc ||= Lxc.new(
    @container,
    :base_dir => node[:lxc][:container_directory]
  )
end

#path(arg = nil) ⇒ Object



15
16
17
# File 'lib/vagabond/cookbooks/lxc/libraries/lxc_expanded_resources.rb', line 15

def path(arg=nil)
  arg ? super(arg) : lxc.expand_path(super(arg))
end