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 +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/lib/vagrant-lxc/driver/cli.rb +14 -4
- data/lib/vagrant-lxc/version.rb +1 -1
- data/spec/unit/driver/cli_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f832d2e6fd41e1b63a88dd5a1916422f4fffd32
|
4
|
+
data.tar.gz: 670c915439fd684e8626266c1c686b20972e7165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -82,10 +82,12 @@ module Vagrant
|
|
82
82
|
opts = cmd.pop
|
83
83
|
namespaces = Array(opts[:namespaces]).map(&:upcase).join('|')
|
84
84
|
|
85
|
-
if
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
data/lib/vagrant-lxc/version.rb
CHANGED
@@ -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)
|