openstack_activeresource 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.11
@@ -0,0 +1,25 @@
1
+ en:
2
+ activemodel:
3
+ errors:
4
+ messages:
5
+ must_contain_at_least_one_digit_or_one_special_character: "must contain at least one digit or one special character"
6
+
7
+ openstack:
8
+ status:
9
+ active: "active"
10
+ awaiting_verification: "awaiting verification"
11
+ building: "building"
12
+ deleted: "deleted"
13
+ hard_rebooting: "hard rebooting"
14
+ in_error: "in error"
15
+ in_rescue_mode: "in rescue mode"
16
+ paused: "paused"
17
+ rebuilding_from_image: "rebuilding from image"
18
+ resetting_password: "resetting password"
19
+ resizing: "resizing"
20
+ revert_resizing: "revert resizing"
21
+ soft_rebooting: "soft rebooting"
22
+ suspended: "suspended"
23
+ unknown: "unknown"
24
+ user_powered_down: "user powered down"
25
+
@@ -197,22 +197,22 @@ module OpenStack
197
197
  end
198
198
 
199
199
  SERVER_STATUSES = {
200
- :ACTIVE => I18n.t(:active),
201
- :BUILD => I18n.t(:builing),
202
- :DELETED => I18n.t(:deleted),
203
- :ERROR => I18n.t(:in_error),
204
- :HARD_REBOOT => I18n.t(:hard_rebooting),
205
- :PASSWORD => I18n.t(:resetting_password),
206
- :REBOOT => I18n.t(:soft_rebooting),
207
- :REBUILD => I18n.t(:rebuilding_from_image),
208
- :RESCUE => I18n.t(:in_rescue_mode),
209
- :RESIZE => I18n.t(:resizing),
210
- :REVERT_RESIZE => I18n.t(:revert_resizing),
211
- :SHUTOFF => I18n.t(:user_powered_down),
212
- :SUSPENDED => I18n.t(:suspended),
213
- :PAUSED => I18n.t(:paused),
214
- :UNKNOWN => I18n.t(:unknown),
215
- :VERIFY_RESIZE => I18n.t(:awaiting_verification)
200
+ :ACTIVE => I18n.t(:active, :scope => [:openstack, :status]),
201
+ :BUILD => I18n.t(:building, :scope => [:openstack, :status]),
202
+ :DELETED => I18n.t(:deleted, :scope => [:openstack, :status]),
203
+ :ERROR => I18n.t(:in_error, :scope => [:openstack, :status]),
204
+ :HARD_REBOOT => I18n.t(:hard_rebooting, :scope => [:openstack, :status]),
205
+ :PASSWORD => I18n.t(:resetting_password, :scope => [:openstack, :status]),
206
+ :REBOOT => I18n.t(:soft_rebooting, :scope => [:openstack, :status]),
207
+ :REBUILD => I18n.t(:rebuilding_from_image, :scope => [:openstack, :status]),
208
+ :RESCUE => I18n.t(:in_rescue_mode, :scope => [:openstack, :status]),
209
+ :RESIZE => I18n.t(:resizing, :scope => [:openstack, :status]),
210
+ :REVERT_RESIZE => I18n.t(:revert_resizing, :scope => [:openstack, :status]),
211
+ :SHUTOFF => I18n.t(:user_powered_down, :scope => [:openstack, :status]),
212
+ :SUSPENDED => I18n.t(:suspended, :scope => [:openstack, :status]),
213
+ :PAUSED => I18n.t(:paused, :scope => [:openstack, :status]),
214
+ :UNKNOWN => I18n.t(:unknown, :scope => [:openstack, :status]),
215
+ :VERIFY_RESIZE => I18n.t(:awaiting_verification, :scope => [:openstack, :status])
216
216
  }.with_indifferent_access
217
217
 
218
218
  # Returns an extended description for the server status
@@ -292,6 +292,26 @@ module OpenStack
292
292
  post(:action, {}, {:'resume' => nil}.to_json)
293
293
  end
294
294
 
295
+ # true if the status is ACTIVE
296
+ def active?
297
+ status == "ACTIVE"
298
+ end
299
+
300
+ # true if the status is PAUSED
301
+ def paused?
302
+ status == "PAUSED"
303
+ end
304
+
305
+ # true if the status is SHUTOFF
306
+ def shutoff?
307
+ status == "SHUTOFF"
308
+ end
309
+
310
+ # true if the status is DELETED
311
+ def deleted?
312
+ status == "DELETED"
313
+ end
314
+
295
315
  end
296
316
 
297
317
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "openstack_activeresource"
8
- s.version = "0.1.10"
8
+ s.version = "0.1.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Davide Guerri"]
12
- s.date = "2013-01-16"
12
+ s.date = "2013-01-17"
13
13
  s.description = "OpenStack Ruby and RoR bindings implemented with ActiveResource - See also http://www.unicloud.it"
14
14
  s.email = "d.guerri@rd.unidata.it"
15
15
  s.extra_rdoc_files = [
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/hot_fixes.rb",
28
- "lib/locales/en.yml",
28
+ "lib/locales/openstack_activeresource.en.yml",
29
29
  "lib/open_stack.rb",
30
30
  "lib/open_stack/base.rb",
31
31
  "lib/open_stack/common.rb",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: openstack_activeresource
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.10
5
+ version: 0.1.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Davide Guerri
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-01-16 00:00:00 Z
13
+ date: 2013-01-17 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -118,7 +118,7 @@ files:
118
118
  - Rakefile
119
119
  - VERSION
120
120
  - lib/hot_fixes.rb
121
- - lib/locales/en.yml
121
+ - lib/locales/openstack_activeresource.en.yml
122
122
  - lib/open_stack.rb
123
123
  - lib/open_stack/base.rb
124
124
  - lib/open_stack/common.rb
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- hash: -1072980844128293330
173
+ hash: 3978403921395978626
174
174
  segments:
175
175
  - 0
176
176
  version: "0"
data/lib/locales/en.yml DELETED
@@ -1,5 +0,0 @@
1
- en:
2
- activemodel:
3
- errors:
4
- messages:
5
- must_contain_at_least_one_digit_or_one_special_character: "must contain at least one digit or one special character"