linux_container 0.9 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v1.0. state() should always return a string
1
2
  v0.9. default to aufs only for 0.8 for ephemeral
2
3
  v0.8. Support lxc 0.9
3
4
  v0.7. Switch to overlayfs
@@ -23,7 +23,8 @@ class LinuxContainer
23
23
  end
24
24
 
25
25
  def state
26
- info('-s').chomp.split(':').last.strip
26
+ res = `#{self.class.sudo_if_needed} lxc-info -n #{Shellwords.escape name} -s 2>&1`
27
+ res.chomp.split(':').last.to_s.strip
27
28
  end
28
29
 
29
30
  def ip
@@ -107,12 +108,12 @@ class LinuxContainer
107
108
  end
108
109
 
109
110
  def execute(*cmd)
110
- cmdstring = "#{self.class.sudo_if_needed} #{cmd.shift} #{Shellwords.join(cmd)} "
111
+ cmdstring = "#{self.class.sudo_if_needed} #{cmd.shift} #{Shellwords.join(cmd)}"
111
112
  result = `#{cmdstring} 2>&1`
112
113
  raise "command failed: #{cmdstring.inspect}\n#{result}" unless $? == 0
113
114
  result
114
115
  end
115
-
116
+
116
117
  def bg_execute(*cmd)
117
118
  logfile_path = "/tmp/lxc_ephemeral_#{Time.now.to_i.to_s(36)}#{$$}#{rand(0x100000000).to_s(36)}.log"
118
119
  cmdstring = "( #{self.class.sudo_if_needed} #{cmd.shift} #{Shellwords.join(cmd)} >>#{logfile_path} 2>>#{logfile_path} & )"
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "linux_container"
5
- s.version = "0.9"
5
+ s.version = "1.0"
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-03-18"
9
+ s.date = "2013-03-19"
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"]
@@ -15,7 +15,16 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Linux_container", "--main", "README.md"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = "linux_container"
18
- s.rubygems_version = "2.0.2"
18
+ s.rubygems_version = "1.8.25"
19
19
  s.summary = "Ruby gem for ephemeral LXC linux containers"
20
20
  s.test_files = ["test/test_all.rb"]
21
+
22
+ if s.respond_to? :specification_version then
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ else
27
+ end
28
+ else
29
+ end
21
30
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux_container
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: '1.0'
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Andrew Snow
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-03-18 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: Ruby gem for ephemeral LXC linux containers
14
15
  email: andrew@modulus.org
@@ -28,7 +29,6 @@ files:
28
29
  - linux_container.gemspec
29
30
  homepage: https://github.com/andys/linux_container
30
31
  licenses: []
31
- metadata: {}
32
32
  post_install_message:
33
33
  rdoc_options:
34
34
  - --line-numbers
@@ -40,20 +40,22 @@ rdoc_options:
40
40
  require_paths:
41
41
  - lib
42
42
  required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
43
44
  requirements:
44
45
  - - ! '>='
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
+ none: false
48
50
  requirements:
49
51
  - - ! '>='
50
52
  - !ruby/object:Gem::Version
51
53
  version: '1.2'
52
54
  requirements: []
53
55
  rubyforge_project: linux_container
54
- rubygems_version: 2.0.2
56
+ rubygems_version: 1.8.25
55
57
  signing_key:
56
- specification_version: 4
58
+ specification_version: 3
57
59
  summary: Ruby gem for ephemeral LXC linux containers
58
60
  test_files:
59
61
  - test/test_all.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTA5NGM3ZTczYmRkZjVkNGM4NmNmZjcxN2U3ZGUyZDJlNjFjMzgxMQ==
5
- data.tar.gz: !binary |-
6
- NWU1OWEwNzAwZWQ4ZjIxZTY0OWJhYTA5NzA2ODBhZDM4N2I5Mzk1Ng==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- Y2JkODhkNTVlNDUwYmI0NjY4MzllNzRkMzM4Y2MyNGI3MTAxODFkMjAzZmE0
10
- ZGUzZDZmMjRiZDQ4MjIxZTYzZGEwODYwNjkwZTVmYjgwYzFiMTY0NzY2ZmU2
11
- ZWE5MTNjMGE5OTUxY2FlMzIzMTEzYmVhNGQ2NDJiOGZiMjFkMmQ=
12
- data.tar.gz: !binary |-
13
- OTYxOWYzYTA2YTVkZTAwNzQ0YWMxZjU4Y2Q4ZWJiYjM3MmNhNTMxY2FiYjlj
14
- ZjhlNWFkYzdhNDM5NzcxNjhkODQyMDIxYzljNGY0NjVlMjRiZmY0YTRjNzcw
15
- ZDNkNzY3YWU1M2NhODJmNDBlMjJmZTEyYzFiZDM1YmViYjI1YzY=