Sha256: b6ce6b38ec2bf59127bd98e068beae3ea467992f1d4d71eae24d2931b9d929de

Contents?: true

Size: 957 Bytes

Versions: 3

Compression:

Stored size: 957 Bytes

Contents

require 'log4r'

require 'vagrant/util/platform'

require_relative 'pd_10'

module VagrantPlugins
  module Parallels
    module Driver
      # Driver for Parallels Desktop 11.
      class PD_11 < PD_10
        def initialize(uuid)
          super(uuid)

          @logger = Log4r::Logger.new('vagrant_parallels::driver::pd_11')
        end

        def create_snapshot(uuid, options)
          args = ['snapshot', uuid]
          args.concat(['--name', options[:name]]) if options[:name]
          args.concat(['--description', options[:desc]]) if options[:desc]

          stdout = execute_prlctl(*args)
          if stdout =~ /\{([\w-]+)\}/
            return $1
          end

          raise Errors::SnapshotIdNotDetected, stdout: stdout
        end

        def read_current_snapshot(uuid)
          if execute_prlctl('snapshot-list', uuid) =~ /\*\{([\w-]+)\}/
            return $1
          end

          nil
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-parallels-1.5.1 lib/vagrant-parallels/driver/pd_11.rb
vagrant-parallels-1.5.0 lib/vagrant-parallels/driver/pd_11.rb
vagrant-parallels-1.4.3 lib/vagrant-parallels/driver/pd_11.rb