vagrant-smartos-zones 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b23f15194df8189c39b2ed6a4d757e9948497185
4
- data.tar.gz: 0fb7e83e3bb27d84cf743ce303ef2a9401f864e6
3
+ metadata.gz: e26bf73ab61dd9d5550e9412d9967db82074561a
4
+ data.tar.gz: 637e034727555d9fcf77b600a156d280c077c080
5
5
  SHA512:
6
- metadata.gz: 19c63f89d059f8aca3098414f774e86e3eb83d1fc7986cf63e22b6e11117817696a6138e3091a09dd6b27c95b78e69f17f394bafe2293b80139b711e1d302ed9
7
- data.tar.gz: 54489755d0f804f002127bfeccf1b971b13c9d993746b8d348b87d3ba5630a43eaa71215e852498685e5b784d899f615958b00bdfba72a24fba7f07372d8466d
6
+ metadata.gz: 253deacdbd67a309dd08ef2afe3bf59304c9768ac48b78e7bc39c7cf97453ba42b257097a6a81a7ff8c6a52714b6b9467dc4540ccb14efebaf7bc809eda82808
7
+ data.tar.gz: 6a182725124c57bf23179a6c89316e91e7af889f76cb61e27e8a6fe341fb445fcb719dcdf2532d48c165a1f8cda2f3567da9c0b7d31c84beb23cfc9c94d6aaf1
@@ -18,8 +18,8 @@ module Vagrant
18
18
  @machine = machine
19
19
  end
20
20
 
21
- def self.create(name, zone)
22
- new(name, zone).create
21
+ def self.create(name, zone, machine)
22
+ new(name, zone, machine).create
23
23
  end
24
24
 
25
25
  def self.install(name, machine)
@@ -29,17 +29,13 @@ module Vagrant
29
29
  def create
30
30
  Zones::Util::Datasets.new(machine.env).setup_smartos_directories
31
31
  prepare_gz
32
- # create_dataset
33
- # download
32
+ create_dataset
33
+ download
34
34
  write_manifest
35
35
  end
36
36
 
37
37
  def exists?
38
- cmd = 'ls %s 2>/dev/null' % remote_filename
39
- with_gz(cmd) do |output|
40
- return true if output.strip == remote_filename
41
- end
42
- false
38
+ machine.communicate.gz_test('ls %s' % remote_filename)
43
39
  end
44
40
 
45
41
  def install
@@ -55,7 +51,7 @@ module Vagrant
55
51
  private
56
52
 
57
53
  def prepare_gz
58
- with_gz('pfexec mkdir /zones/vagrant')
54
+ with_gz('pfexec mkdir -p /zones/vagrant')
59
55
  with_gz('pfexec chown vagrant:vagrant /zones/vagrant')
60
56
  end
61
57
 
@@ -69,7 +65,7 @@ module Vagrant
69
65
  zone.stop
70
66
  Models::Snapshot.around(zone) do |snapshot|
71
67
  machine.ui.info(I18n.t('vagrant.smartos.zones.commands.dataset.save'))
72
- cmd = 'pfexec /usr/bin/bash -l -c "/usr/sbin/zfs send %s | /usr/bin/bzip2 > %s"'
68
+ cmd = 'pfexec /usr/bin/bash -l -c "/usr/sbin/zfs send %s | /usr/bin/gzip > %s"'
73
69
  with_gz(cmd % [snapshot.path, remote_filename])
74
70
  end
75
71
  end
@@ -92,7 +88,7 @@ module Vagrant
92
88
  end
93
89
 
94
90
  def filename
95
- '%s.zfs.bz2' % name
91
+ '%s.zfs.gz' % name
96
92
  end
97
93
 
98
94
  def local_filename
@@ -61,7 +61,7 @@ module Vagrant
61
61
  def files
62
62
  [
63
63
  {
64
- 'path' => "#{name}.zfs.bz2",
64
+ 'path' => "#{name}.zfs.gz",
65
65
  'sha1' => sha1,
66
66
  'size' => size
67
67
  }
@@ -23,11 +23,11 @@ module Vagrant
23
23
  end
24
24
 
25
25
  def sha1(name)
26
- Digest::SHA1.file(dataset_dir.join("#{name}.zfs.bz2")).hexdigest
26
+ Digest::SHA1.file(dataset_dir.join("#{name}.zfs.gz")).hexdigest
27
27
  end
28
28
 
29
29
  def size(name)
30
- ::File.size(dataset_dir.join("#{name}.zfs.bz2"))
30
+ ::File.size(dataset_dir.join("#{name}.zfs.gz"))
31
31
  end
32
32
 
33
33
  private
@@ -41,8 +41,8 @@ module Vagrant
41
41
  end
42
42
 
43
43
  def datasets
44
- Dir[dataset_dir.join('*.zfs.bz2')].map do |f|
45
- File.basename(f, '.zfs.bz2')
44
+ Dir[dataset_dir.join('*.zfs.gz')].map do |f|
45
+ File.basename(f, '.zfs.gz')
46
46
  end.sort
47
47
  end
48
48
 
@@ -1,7 +1,7 @@
1
1
  module Vagrant
2
2
  module Smartos
3
3
  module Zones
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-smartos-zones
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Saxby
@@ -192,3 +192,4 @@ test_files:
192
192
  - test/integration/default/serverspec/user_spec.rb
193
193
  - test/templates/Vagrantfile.smartos.erb
194
194
  - test/templates/bootstrap.sh
195
+ has_rdoc: