class CORL::Node::Vagrant

Public Instance Methods

bootstrap_script() click to toggle source
# File lib/CORL/node/vagrant.rb, line 80
def bootstrap_script
  cache_setting(:bootstrap, nil)  
end
bootstrap_script=(bootstrap) click to toggle source
# File lib/CORL/node/vagrant.rb, line 76
def bootstrap_script=bootstrap
  set_cache_setting(:bootstrap, bootstrap)
end
build(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 105
def build(options = {})
  super(Config.ensure(options).import({ :save => false }))  
end
build_time() click to toggle source
# File lib/CORL/node/vagrant.rb, line 70
def build_time
  cache_setting(:build, nil)
end
build_time=(time) click to toggle source
# File lib/CORL/node/vagrant.rb, line 66
def build_time=time
  set_cache_setting(:build, time)
end
create(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 111
def create(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:create))
      config[:provision_enabled] = false
    end     
  end
end
create_image(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 183
def create_image(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:image))
    end
  end
end
destroy(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 205
def destroy(options = {})    
  super do |op, config|
    if op == :config
      config.import(exec_options(:destroy))
    end
  end
end
download(remote_path, local_path, options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 122
def download(remote_path, local_path, options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:download))
    end
  end
end
exec(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 142
def exec(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:exec))
    end
  end
end
exec_options(name, options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 98
def exec_options(name, options = {})
  extended_config(name, options).export
end
filter_output(type, data) click to toggle source
# File lib/CORL/node/vagrant.rb, line 225
def filter_output(type, data)
  if type == :error
    if data.include?('stdin: is not a tty') || data.include?('unable to re-open stdin')
      data = ''  
    end
  end
  data  
end
image_id(image) click to toggle source
# File lib/CORL/node/vagrant.rb, line 250
def image_id(image)
  image.id
end
image_search_text(image) click to toggle source
# File lib/CORL/node/vagrant.rb, line 262
def image_search_text(image)
  image.to_s
end
init_shares() click to toggle source
# File lib/CORL/node/vagrant.rb, line 216
def init_shares
  shares.each do |name, info|
    local_dir = info[:local]
    network.ignore(local_dir)      
  end
end
machine_config() { |config| ... } click to toggle source
# File lib/CORL/node/vagrant.rb, line 87
def machine_config
  super do |config|        
    config[:vm]     = vm
    config[:shares] = shares
    
    yield(config) if block_given?
  end
end
machine_type_id(machine_type) click to toggle source
# File lib/CORL/node/vagrant.rb, line 237
def machine_type_id(machine_type)
  machine_type
end
normalize(reload) { || ... } click to toggle source
# File lib/CORL/node/vagrant.rb, line 9
def normalize(reload)
  super
  
  unless reload
    machine_provider = :vagrant
    machine_provider = yield if block_given?
                      
    myself.machine = create_machine(:machine, machine_provider, machine_config)
  end
  
  network.ignore([ '.vagrant', 'boxes' ])
  init_shares
end
reload(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 172
def reload(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:reload))
      config[:provision_enabled] = false
    end
  end
end
render_image(image) click to toggle source
# File lib/CORL/node/vagrant.rb, line 256
def render_image(image)
  ''  
end
render_machine_type(machine_type) click to toggle source
# File lib/CORL/node/vagrant.rb, line 243
def render_machine_type(machine_type)
  machine_type.to_s
end
save(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 152
def save(options = {})
  super do
    id(true)
    delete_setting(:machine_type)  
  end  
end
shares() click to toggle source
# File lib/CORL/node/vagrant.rb, line 60
def shares
  hash(myself[:shares])
end
shares=(shares) click to toggle source
# File lib/CORL/node/vagrant.rb, line 55
def shares=shares
  myself[:shares] = shares
  init_shares
end
ssh() click to toggle source
# File lib/CORL/node/vagrant.rb, line 49
def ssh
  hash(myself[:ssh])
end
ssh=(ssh) click to toggle source
# File lib/CORL/node/vagrant.rb, line 45
def ssh=ssh
  myself[:ssh] = ssh
end
start(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 161
def start(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:start))
      config[:provision_enabled] = false
    end
  end
end
state(reset = false) click to toggle source
# File lib/CORL/node/vagrant.rb, line 29
def state(reset = false)
  machine.state
end
stop(options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 193
def stop(options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:stop))
    elsif op == :finalize
      true
    end
  end
end
upload(local_path, remote_path, options = {}) click to toggle source
# File lib/CORL/node/vagrant.rb, line 132
def upload(local_path, remote_path, options = {})
  super do |op, config|
    if op == :config
      config.import(exec_options(:upload))
    end
  end
end
vm() click to toggle source
# File lib/CORL/node/vagrant.rb, line 39
def vm
  hash(myself[:vm])
end
vm=(vm) click to toggle source
# File lib/CORL/node/vagrant.rb, line 35
def vm=vm
  myself[:vm] = vm
end