vagrant-sptsync 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmIyNDAwZTgyNTc3MThjZGIzZjhkZWJiMjJjYWUyNDNjNzUzZjVmZA==
4
+ YWM3MjJkMTdhODQzYjYyNWUyNjZlODYxOTk0NmIwNGI0MDdlYmVmNQ==
5
5
  data.tar.gz: !binary |-
6
- MDcxN2EyN2UzOGU2ZjE2MjI4MjRkYWExNzQ1Y2RiOTJiZGUyZjJkYQ==
6
+ MGU4NjYxY2U4Y2EyNjNiNGM4OTUwMzQ1NDhlNjdjZjU0M2I5ZGU2MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTJmYTY2NWIwZjNkZWY3OTU4NzgyMzBlYjQ2OWM5OGM4N2Q3ZWY1NzI1ZmYy
10
- MTA3MjU1YmQzNDU3MTRhOWZmYTdiZTg5Yzc0NzQ1ZjgzODE3MTdhMGMzOTRh
11
- ZmJiYjFmNzVkZjMxMWM3NTQxMjJhNDI1ZWY4N2ZmNGRjZDE0ZTE=
9
+ MDFlYThlZDIzZTNjYWU1ODlkMWQxOGMyNTAwNGM4Y2QzOTNkNjY3MzEyODhk
10
+ YzQ1NzU5NTljMDUwMTcwNzU3ZDk1MWU3NTk0YzhhYmU2NGU2NzFlMDNiMGIw
11
+ N2Y5YTNkMDM5MzRhMDU1YzFhMjZmY2Y5N2Q3MThhNmE3NGU0ODY=
12
12
  data.tar.gz: !binary |-
13
- YWI5ZjBhZmEzNGNlYTM4YjkyODlmYmE2NjBiNzY3YTkwZTk1MTQ4OTBhYmZi
14
- NWVkN2Q4MmUyNGJiMzBmYzVkM2JmMjFiNDg2NzkwYzlkNzQ2N2M4YTk1MTI2
15
- MjM3YWM5MjI5ZmQ2YjdiZWRiYmI0MDRhNjlhMzNlMWJlYzQwMzM=
13
+ OWUyZGExNjNiMGVmNGFhOTVmYWQ0MzFlN2MyNTRlMGQwYzViZmU3MzI3Njhj
14
+ ZjE4ZjUwOTAwNGU4MTgyOTc4NTJiMjdjMTNhY2JlZjkzMmJmMGY4YmNiOTBm
15
+ NGYxOTE5OTI0ZGU4MjhlN2QxODg1ZDhhM2E2NDBiODVlZWRlOTE=
@@ -44,7 +44,11 @@ module VagrantPlugins
44
44
 
45
45
  # # Initialize and execute the command class
46
46
  # command_class.new(@sub_args, @env).execute
47
- puts "hello"
47
+ with_target_vms(argv) do |machine|
48
+ machine.provider.driver.execute("ls") do |type, data|
49
+ machine.env.ui.info(data, :color => type == :stderr ? :red : :white)
50
+ end
51
+ end
48
52
  0
49
53
  end
50
54
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module SPTSync
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-sptsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Sehr
@@ -50,13 +50,7 @@ files:
50
50
  - Rakefile
51
51
  - Vagrantfile
52
52
  - lib/vagrant-sptsync.rb
53
- - lib/vagrant-sptsync/commands/back.rb
54
- - lib/vagrant-sptsync/commands/delete.rb
55
- - lib/vagrant-sptsync/commands/go.rb
56
- - lib/vagrant-sptsync/commands/list.rb
57
- - lib/vagrant-sptsync/commands/multi_vm_args.rb
58
53
  - lib/vagrant-sptsync/commands/root.rb
59
- - lib/vagrant-sptsync/commands/take.rb
60
54
  - lib/vagrant-sptsync/plugin.rb
61
55
  - lib/vagrant-sptsync/version.rb
62
56
  - vagrant-sptsync.gemspec
@@ -1,39 +0,0 @@
1
- module VagrantPlugins
2
- module VBoxSnapshot
3
- module Command
4
- class Back < Vagrant.plugin(2, :command)
5
- def execute
6
- options = {}
7
-
8
- opts = OptionParser.new do |opts|
9
- opts.banner = "Back to current snapshot"
10
- opts.separator ""
11
- opts.separator "Usage: vagrant snapshot back [vm-name]"
12
- end
13
- # Parse the options
14
- argv = parse_options(opts)
15
- return if !argv
16
-
17
- with_target_vms(argv, single_target: true) do |machine|
18
-
19
- if machine.state.id != :poweroff
20
- machine.provider.driver.execute("controlvm", machine.id, "poweroff")
21
- end
22
-
23
- machine.provider.driver.execute("snapshot", machine.id, "restorecurrent") do |type, data|
24
- machine.env.ui.info(data, :color => type == :stderr ? :red : :white, :new_line => false)
25
- end
26
-
27
- if options[:reload]
28
- @env.ui.info("Reloading VM, since --reload passed")
29
- machine.action(:reload, :provision_enabled => false)
30
- else
31
- @env.ui.info("Starting restored VM")
32
- machine.action(:up, :provision_enabled => false)
33
- end
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,36 +0,0 @@
1
- # this command is very slow
2
- # consider removing it; or replacing with this idea: http://superuser.com/questions/590968/quickest-way-to-merge-snapshots-in-virtualbox
3
-
4
- require_relative 'multi_vm_args'
5
-
6
- module VagrantPlugins
7
- module VBoxSnapshot
8
- module Command
9
- class Delete < Vagrant.plugin(2, :command)
10
- include MultiVmArgs
11
-
12
- def execute
13
- options = {}
14
-
15
- opts = OptionParser.new do |opts|
16
- opts.banner = "Delete snapshot (warning: this is a very slow operation)"
17
- opts.separator ""
18
- opts.separator "Usage: vagrant snapshot delete [vm-name] <SNAPSHOT_NAME>"
19
- end
20
- # Parse the options
21
- argv = parse_options(opts)
22
- return if !argv
23
-
24
- vm_name, snapshot_name = parse_vm_and_snapshot_options(argv, opts)
25
- return if !snapshot_name
26
-
27
- with_target_vms(vm_name, single_target: true) do |machine|
28
- machine.provider.driver.execute("snapshot", machine.id, "delete", snapshot_name) do |type, data|
29
- machine.env.ui.info(data, :color => type == :stderr ? :red : :white)
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,82 +0,0 @@
1
- require_relative 'multi_vm_args'
2
-
3
- module VagrantPlugins
4
- module VBoxSnapshot
5
- module Command
6
- class Go < Vagrant.plugin(2, :command)
7
- include MultiVmArgs
8
-
9
- def get_shared_folders(machine)
10
- shared_folders = []
11
- info = machine.provider.driver.execute("showvminfo", machine.id, "--machinereadable")
12
- info.split("\n").each do |line|
13
- if line =~ /^SharedFolderNameMachineMapping\d+="(.+?)"$/
14
- shared_folders << $1.to_s
15
- end
16
- end
17
- return shared_folders
18
- end
19
-
20
- def before_restore(machine)
21
- @shared_folders_before = get_shared_folders(machine)
22
- end
23
-
24
- def after_restore(machine)
25
- @shared_folders_after = get_shared_folders(machine)
26
- if @shared_folders_before != @shared_folders_after
27
- @env.ui.warn("Synced folders have changed after restoring snapshot. Consider running 'vagrant reload'.")
28
- @env.ui.warn(" Before restore: #{@shared_folders_before}")
29
- @env.ui.warn(" After restore: #{@shared_folders_after}")
30
- end
31
- end
32
-
33
- def execute
34
- options = {}
35
- options[:reload] = false
36
-
37
- opts = OptionParser.new do |opts|
38
- opts.banner = "Go to specified snapshot"
39
- opts.separator ""
40
- opts.separator "Usage: vagrant snapshot go [vm-name] <SNAPSHOT_NAME>"
41
-
42
- opts.on("-r", "--reload", "Runs 'vagrant reload --no-provision' after restoring snapshot to ensure Vagrantfile config is applied.") do |reload|
43
- options[:reload] = reload
44
- end
45
-
46
- end
47
- # Parse the options
48
- argv = parse_options(opts)
49
- return if !argv
50
-
51
- vm_name, snapshot_name = parse_vm_and_snapshot_options(argv, opts)
52
- return if !snapshot_name
53
-
54
- with_target_vms(vm_name, single_target: true) do |machine|
55
- vm_id = machine.id
56
-
57
- before_restore(machine)
58
-
59
- if machine.state.id != :poweroff
60
- @env.ui.info("Powering off machine #{vm_id}")
61
- machine.provider.driver.execute("controlvm", machine.id, "poweroff")
62
- end
63
-
64
- machine.provider.driver.execute("snapshot", machine.id, "restore", snapshot_name) do |type, data|
65
- machine.env.ui.info(data, :color => type == :stderr ? :red : :white, :new_line => false)
66
- end
67
-
68
- if options[:reload]
69
- @env.ui.info("Reloading VM, since --reload passed")
70
- machine.action(:reload, :provision_enabled => false)
71
- else
72
- @env.ui.info("Starting restored VM")
73
- machine.action(:up, :provision_enabled => false)
74
- end
75
-
76
- after_restore(machine)
77
- end
78
- end
79
- end
80
- end
81
- end
82
- end
@@ -1,28 +0,0 @@
1
- module VagrantPlugins
2
- module VBoxSnapshot
3
- module Command
4
- class List < Vagrant.plugin(2, :command)
5
- def execute
6
- options = {}
7
-
8
- opts = OptionParser.new do |opts|
9
- opts.banner = "List snapshots"
10
- opts.separator ""
11
- opts.separator "Usage: vagrant snapshot list"
12
- end
13
- # Parse the options
14
- argv = parse_options(opts)
15
- return if !argv
16
-
17
- with_target_vms(argv, single_target: true) do |machine|
18
- puts "Listing snapshots for '#{machine.name}':"
19
-
20
- res = machine.provider.driver.execute("snapshot", machine.id, "list", "--details") do |type, data|
21
- machine.env.ui.info(data, :color => :green) if (type == :stdout)
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,20 +0,0 @@
1
- module VagrantPlugins
2
- module VBoxSnapshot
3
- module Command
4
- module MultiVmArgs
5
- def parse_vm_and_snapshot_options(argv, opts)
6
- unless [1, 2].include?(argv.size)
7
- @env.ui.info(opts.help, :prefix => false)
8
- return
9
- end
10
-
11
- if argv.size == 1
12
- [nil, argv[0]]
13
- else
14
- [argv[0], argv[1]]
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,34 +0,0 @@
1
- require_relative 'multi_vm_args'
2
-
3
- module VagrantPlugins
4
- module VBoxSnapshot
5
- module Command
6
- class Take < Vagrant.plugin(2, :command)
7
- include MultiVmArgs
8
-
9
- def execute
10
- options = {}
11
-
12
- opts = OptionParser.new do |opts|
13
- opts.banner = "Take snapshot"
14
- opts.separator ""
15
- opts.separator "Usage: vagrant snapshot take [vm-name] <SNAPSHOT_NAME>"
16
- end
17
- # Parse the options
18
- argv = parse_options(opts)
19
- return if !argv
20
-
21
- vm_name, snapshot_name = parse_vm_and_snapshot_options(argv, opts)
22
- return if !snapshot_name
23
-
24
- with_target_vms(vm_name, single_target: true) do |machine|
25
- machine.env.ui.info("Taking snapshot #{snapshot_name}")
26
- machine.provider.driver.execute("snapshot", machine.id, "take", snapshot_name, "--pause") do |type, data|
27
- machine.env.ui.info(data, :color => type == :stderr ? :red : :white, :new_line => false)
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end