lxc 0.1.2 → 0.1.3

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.
@@ -176,10 +176,14 @@ class LXC
176
176
  # @param [Array] args Additional command-line arguments.
177
177
  # @return [Symbol] Current state of the container.
178
178
  def state(*args)
179
- result = self.info("--state", *args).collect{ |str| str.scan(REGEX_STATE) }
180
- result.flatten!.compact!
179
+ if self.exists?
180
+ result = self.info("--state", *args).collect{ |str| str.scan(REGEX_STATE) }
181
+ result.flatten!.compact!
181
182
 
182
- (result.first.strip.downcase.to_sym rescue :unknown)
183
+ (result.first.strip.downcase.to_sym rescue :unknown)
184
+ else
185
+ :not_created
186
+ end
183
187
  end
184
188
 
185
189
  # PID of the container
@@ -2,7 +2,7 @@ class LXC
2
2
 
3
3
  unless const_defined?(:VERSION)
4
4
  # LXC Gem Version
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
 
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: 4168689960040031233
185
+ hash: 3311340983123551161
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: 4168689960040031233
194
+ hash: 3311340983123551161
195
195
  requirements: []
196
196
  rubyforge_project:
197
197
  rubygems_version: 1.8.25