ohai 7.0.0.rc.2 → 7.0.0.rc.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf35511e9eb60b6d08168730774fa4b5dfe862d
|
4
|
+
data.tar.gz: f6f47ef693511a5e65101366ae5bfc9213b925b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b193999564638067a25ab8a6fb63004cbd0a42a32f2018635aeb2212bee18e2aab7030b7dec75ad0cbd9603ad200176202668ede9c61c195d7bd811334cd49bc
|
7
|
+
data.tar.gz: b2d312b317e51911b05a3588de31363cb3e5a8adbbb06d0dc7b2beafcb5b7489cadce751f9791f3528428055bbd53c8ca8bbcc6a710bcaca56ffdf244876d51a
|
@@ -146,10 +146,10 @@ Ohai.plugin(:Virtualization) do
|
|
146
146
|
# Full notes, https://tickets.opscode.com/browse/OHAI-551
|
147
147
|
# Kernel docs, https://www.kernel.org/doc/Documentation/cgroups
|
148
148
|
if File.exists?("/proc/self/cgroup")
|
149
|
-
if File.read("/proc/self/cgroup") =~ %r{^\d
|
149
|
+
if File.read("/proc/self/cgroup") =~ %r{^\d+:[^:]+:/(lxc|docker)/.+$}
|
150
150
|
virtualization[:system] = "lxc"
|
151
151
|
virtualization[:role] = "guest"
|
152
|
-
elsif File.read("/proc/self/cgroup") =~ %r{\d
|
152
|
+
elsif File.read("/proc/self/cgroup") =~ %r{\d:[^:]+:/$}
|
153
153
|
virtualization[:system] = "lxc"
|
154
154
|
virtualization[:role] = "host"
|
155
155
|
end
|
data/lib/ohai/version.rb
CHANGED
@@ -300,7 +300,27 @@ CGROUP
|
|
300
300
|
@plugin[:virtualization][:role].should == "guest"
|
301
301
|
end
|
302
302
|
|
303
|
-
it "should set
|
303
|
+
it "should set lxc guest if /proc/self/cgroup exist and there are /docker/<name> mounts" do
|
304
|
+
self_cgroup=<<-CGROUP
|
305
|
+
11:hugetlb:/
|
306
|
+
10:perf_event:/
|
307
|
+
9:blkio:/
|
308
|
+
8:net_cls:/
|
309
|
+
7:freezer:/
|
310
|
+
6:devices:/
|
311
|
+
5:memory:/
|
312
|
+
4:cpuacct,cpu:/docker/9c2adaa4c391ec0d3bf994fbd91ff30c3d317694d179e5b1dc7e1e4c8ed56b61
|
313
|
+
3:cpuset:/
|
314
|
+
2:name=systemd:/system.slice/docker.service
|
315
|
+
CGROUP
|
316
|
+
File.should_receive(:exists?).with("/proc/self/cgroup").and_return(true)
|
317
|
+
File.stub(:read).with("/proc/self/cgroup").and_return(self_cgroup)
|
318
|
+
@plugin.run
|
319
|
+
@plugin[:virtualization][:system].should == "lxc"
|
320
|
+
@plugin[:virtualization][:role].should == "guest"
|
321
|
+
end
|
322
|
+
|
323
|
+
it "should set not set anything if /proc/self/cgroup exist and the cgroup is named arbitrarily, it isn't necessarily lxc." do
|
304
324
|
self_cgroup=<<-CGROUP
|
305
325
|
8:blkio:/Charlie
|
306
326
|
7:net_cls:/Charlie
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.0.rc.
|
4
|
+
version: 7.0.0.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|