Sha256: 5ddc470494808f0987bcfed3b6fe446725e9c261128187ac83fb5d27d91831e0

Contents?: true

Size: 895 Bytes

Versions: 3

Compression:

Stored size: 895 Bytes

Contents

module VagrantPlugins
  module VCloud
    module Action
      class IsCreated
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new("vagrant_vcloud::action::is_created")
        end

        def call(env)
         
          vAppId = env[:machine].get_vapp_id
          
          if vAppId.nil?
            @logger.warn("vApp has not been created")
            env[:result] = false
          else
            @logger.info("vApp has been created and ID is: [#{vAppId}]")
            
            vmId = env[:machine].id
            if vmId
              @logger.info("VM has been added to vApp and ID is: [#{vmId}]")
              env[:result] = true
           else
              @logger.warn("VM has not been added to vApp")
              env[:result] = false
           end

          end

          @app.call env
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-vcloud-0.1.2 lib/vagrant-vcloud/action/is_created.rb
vagrant-vcloud-0.1.1 lib/vagrant-vcloud/action/is_created.rb
vagrant-vcloud-0.1.0 lib/vagrant-vcloud/action/is_created.rb