linux_container 1.3 → 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/CHANGELOG +1 -0
- data/README.md +3 -1
- data/lib/linux_container.rb +5 -0
- data/linux_container.gemspec +2 -2
- data/test/test_all.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mjc1ZDc1MDMyZTBhNDJhZDNmMGRlZTgzZjIzZjNiMzEyZDlhMzUyZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzU1MDUyMjQyYzk2OWE5NTg4ZmRmOGEzYzRhNjVjMTAxNzBjZjYwNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWVmMmQxMzhkZTQ1MjI2MGQ2ZjEyOGM0OTZjZWZhNGQ2ZTcyNzAzNzM4YjA2
|
10
|
+
NDM2YTcwZDc5ZjAyYWQ5YjcyZDgyODk2Y2ViZDI1MzVjMjVkNDcwNjZiMzdm
|
11
|
+
NWY4N2U0OTIxYWMwYTQyMjk1ZGMwZjA2NDk1NWM3YzUyZDg2NjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjJiM2EyZTAwZjVkYjY1Yjc0Njk2NjQ1NTdlNTVlNzBhMDYxMzIzM2QyMjJi
|
14
|
+
M2U5MjQyMjk0ZGI3ODRmMGJlMTc3Y2Q3NDQyNzc5MWE3OTQ5MWNiY2FhMjkx
|
15
|
+
YzYwNTI5ZDBmMjM1ZmNhMjJkYjE5OWZjZDA0NTJmZjJkNGUxNjI=
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -43,6 +43,8 @@ very little disk space, which then disappears when shut down.
|
|
43
43
|
|
44
44
|
> e = c.start_ephemeral
|
45
45
|
> e.wait_for { ip && sshable? }
|
46
|
+
> e.parent_container
|
47
|
+
=> #<LinuxContainer:...>
|
46
48
|
|
47
49
|
|
48
50
|
### Clone an existing container and start it in background, with 512M memlimit
|
@@ -62,7 +64,7 @@ very little disk space, which then disappears when shut down.
|
|
62
64
|
> c.shutdown '-t', '120'
|
63
65
|
|
64
66
|
|
65
|
-
### Force shutdown
|
67
|
+
### Force shutdown & delete
|
66
68
|
|
67
69
|
> c.destroy '-f'
|
68
70
|
|
data/lib/linux_container.rb
CHANGED
@@ -44,6 +44,11 @@ class LinuxContainer
|
|
44
44
|
fromname = self.class === from ? from.name : from
|
45
45
|
lxc_execute('clone', '-o',fromname, *args)
|
46
46
|
end
|
47
|
+
|
48
|
+
def parent_container
|
49
|
+
n = name.dup
|
50
|
+
self.class.new(name: n) if n.sub!(/-temp-[0-9A-Za-z]+$/, '')
|
51
|
+
end
|
47
52
|
|
48
53
|
def start_ephemeral(config={})
|
49
54
|
argshash = {'orig' => name, 'user' => username}.merge!(config)
|
data/linux_container.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "linux_container"
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Andrew Snow"]
|
9
|
-
s.date = "2013-04-
|
9
|
+
s.date = "2013-04-24"
|
10
10
|
s.description = "Ruby gem for ephemeral LXC linux containers"
|
11
11
|
s.email = "andrew@modulus.org"
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "README.md", "lib/linux_container.rb"]
|
data/test/test_all.rb
CHANGED
@@ -44,7 +44,8 @@ class TestLinuxContainer < MiniTest::Unit::TestCase
|
|
44
44
|
|
45
45
|
def test_ephemeral
|
46
46
|
assert($ec = $c.start_ephemeral)
|
47
|
-
assert_match /^linuxcontainergemtest
|
47
|
+
assert_match /^linuxcontainergemtest-temp-[a-zA-Z0-9]+$/, $ec.name
|
48
|
+
assert_equal $c.name, $ec.parent_container.name
|
48
49
|
assert($ec.wait_for { running? }, 'wait_for running?')
|
49
50
|
assert($ec.wait_for { ip }, 'wait_for ip')
|
50
51
|
assert($ec.wait_for { sshable? }, 'wait_for sshable?')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Snow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby gem for ephemeral LXC linux containers
|
14
14
|
email: andrew@modulus.org
|