vagrant-lxc 0.6.1 → 0.6.2

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: d037f1ba303000765f7744d6400f4d6191e24689
4
- data.tar.gz: ef8dbd484d7768f7b1cdd6efc9d9fed64504b1b0
3
+ metadata.gz: 7f832d2e6fd41e1b63a88dd5a1916422f4fffd32
4
+ data.tar.gz: 670c915439fd684e8626266c1c686b20972e7165
5
5
  SHA512:
6
- metadata.gz: fb469f28e25a5521c907f316df78e4274aaa5c198a39ee89bf2a0500abc7193101b2283a54ea370203f815e92ab98fdf015b0098cd276b0b0d8d72d4c82d2b02
7
- data.tar.gz: 6c8fc71c88a63a3cd790d7a7577ae8eedf35c920fd611fcf93fdd8951647992c43929f0edc4c45598f58a49efa99d4e165e627098eb8b29e91b93938633e0e2d
6
+ metadata.gz: b14dfc2a2736cd770ece958308cb7b57220021f0d20208a746d2a79ba6ea9222d6aade55ce45c8471961c4dd4c24840278a558d09138e2eba711b64ed7186f25
7
+ data.tar.gz: be33ff31ddbe43c3700ce7e507ffa164802d718f36075283e24d2d185d075794058e67db3b2a3575de7cd3b6e0889ad75c95b09c806c0cd39b044ad884c89970
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.6.2](https://github.com/fgrehm/vagrant-lxc/compare/v0.6.1...v0.6.2) (Oct 03, 2013)
2
+
3
+ IMPROVEMENTS:
4
+
5
+ - Cache the result of `lxc-attach --namespaces` parameter support checking to
6
+ avoid excessive logging.
7
+
8
+ BUG FIXES:
9
+
10
+ - Fix detection of `lxc-attach --namespaces` parameter support checking.
11
+
1
12
  ## [0.6.1](https://github.com/fgrehm/vagrant-lxc/compare/v0.6.0...v0.6.1) (Oct 03, 2013)
2
13
 
3
14
  IMPROVEMENTS:
data/Gemfile.lock CHANGED
@@ -26,7 +26,7 @@ GIT
26
26
  PATH
27
27
  remote: .
28
28
  specs:
29
- vagrant-lxc (0.6.1)
29
+ vagrant-lxc (0.6.2)
30
30
 
31
31
  GEM
32
32
  remote: https://rubygems.org/
@@ -82,10 +82,12 @@ module Vagrant
82
82
  opts = cmd.pop
83
83
  namespaces = Array(opts[:namespaces]).map(&:upcase).join('|')
84
84
 
85
- if run(:attach, '-h').include?('--namespaces')
86
- extra = ['--namespaces', namespaces] if namespaces
87
- else
88
- raise LXC::Errors::NamespacesNotSupported
85
+ if namespaces
86
+ if supports_attach_with_namespaces?
87
+ extra = ['--namespaces', namespaces] if namespaces
88
+ else
89
+ raise LXC::Errors::NamespacesNotSupported
90
+ end
89
91
  end
90
92
  end
91
93
 
@@ -114,6 +116,14 @@ module Vagrant
114
116
  def run(command, *args)
115
117
  @sudo_wrapper.run("lxc-#{command}", *args)
116
118
  end
119
+
120
+ def supports_attach_with_namespaces?
121
+ unless defined?(@supports_attach_with_namespaces)
122
+ @supports_attach_with_namespaces = run(:attach, '-h', '2>&1').include?('--namespaces')
123
+ end
124
+
125
+ return @supports_attach_with_namespaces
126
+ end
117
127
  end
118
128
  end
119
129
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module LXC
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
@@ -146,13 +146,13 @@ describe Vagrant::LXC::Driver::CLI do
146
146
  end
147
147
 
148
148
  it 'supports a "namespaces" parameter' do
149
- subject.stub(:run).with(:attach, '-h').and_return('--namespaces')
149
+ subject.stub(:run).with(:attach, '-h', '2>&1').and_return('--namespaces')
150
150
  subject.attach *(command + [{namespaces: ['network', 'mount']}])
151
151
  subject.should have_received(:run).with(:attach, '--name', name, '--namespaces', 'NETWORK|MOUNT', '--', *command)
152
152
  end
153
153
 
154
154
  it 'raises a NamespacesNotSupported error if not supported' do
155
- subject.stub(:run).with(:attach, '-h').and_return('not supported')
155
+ subject.stub(:run).with(:attach, '-h', '2>&1').and_return('not supported')
156
156
  expect {
157
157
  subject.attach *(command + [{namespaces: ['network', 'mount']}])
158
158
  }.to raise_error(Vagrant::LXC::Errors::NamespacesNotSupported)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-lxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm