Sha256: 62685a29f0ecac4671ea06465c439e8f6b22e0316969d1ee4657f734059f081d
Contents?: true
Size: 1.53 KB
Versions: 2
Compression:
Stored size: 1.53 KB
Contents
require 'pathname' require 'vagrant-vcloudair/plugin' module VagrantPlugins module VCloudAir lib_path = Pathname.new(File.expand_path('../vagrant-vcloudair', __FILE__)) autoload :Action, lib_path.join('action') autoload :Errors, lib_path.join('errors') # This returns the path to the source of this plugin. # # @return [Pathname] def self.source_root @source_root ||= Pathname.new(File.expand_path('../../', __FILE__)) end end end module Vagrant class Machine attr_reader :vappid def vappid=(value) @logger.info("New vApp ID: #{value.inspect}") # The file that will store the id if we have one. This allows the # ID to persist across Vagrant runs. id_file = @data_dir.join('../../../vcloudair_vappid') ### this should be ./.vagrant/vcloudair_vappid if value # Write the "id" file with the id given. id_file.open('w+') do |f| f.write(value) end else # Delete the file, since the machine is now destroyed id_file.delete if id_file.file? end # Store the ID locally @vappid = value # Notify the provider that the ID changed in case it needs to do # any accounting from it. # @provider.machine_id_changed end # This returns the vCloud Air vApp ID. # # @return [vAppId] def get_vapp_id vappid_file = @data_dir.join('../../../vcloudair_vappid') if vappid_file.file? @vappid = vappid_file.read else nil end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-vcloudair-0.5.1 | lib/vagrant-vcloudair.rb |
vagrant-vcloudair-0.5.0 | lib/vagrant-vcloudair.rb |