shelly 0.4.36 → 0.4.37

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: 38bef5b682a08b32dc16b8c9f53bfa315c7519b9
4
- data.tar.gz: c237d97ce913a8fa7a257a476f47c1b4b370cc2d
3
+ metadata.gz: a8cae11e143cf0b16eed1f5fb61648b887b0f549
4
+ data.tar.gz: 8f652dc1ed1c0dc2b7e94294e3cc4dd4c8155eac
5
5
  SHA512:
6
- metadata.gz: d5ae8c903c04f1eea25044b9bd75061f8992487734fc8718fea4f63835a66e0e12d6e5ffb4ea77500714b2a8cb03ec59f9ca7f9177547e50ab284b0fecf3bd42
7
- data.tar.gz: 538eb932812a5f9c9bda35ce94b95966aacd8ee65bed9c5614134f3c3bfe9baba5f5976432fb586b2dab8a117dcc4fdbaae9e347c7a0bbb4af3c71b7f070e8e8
6
+ metadata.gz: d9d71e7c7ffa22775081bbece8f2322d4fd7c831fb3dae334763b68367a4fe4278328fea24546c8a01f53dddd7c6bea496e02e13870c39ff03ba1bf76f6d16da
7
+ data.tar.gz: f6b3271721e16360b342e123cdcf01bf6c5f015c8064c7338b744a725e48371caa7130b134847ffaa81937c7b0655b7a62d8ba6158e2b1735294ff536b200ab8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.37 / 2014-09-01
2
+
3
+ * [bugfix] print user-friendly message if user tries to finish maintenance, but
4
+ there is no maintenance events for given cloud
5
+
1
6
  ## 0.4.36 / 2014-08-26
2
7
 
3
8
  * [improvement] show custom processes in deployment logs
@@ -46,6 +46,8 @@ module Shelly
46
46
  say "Maintenance has been started", :green
47
47
  rescue Client::ValidationException => exception
48
48
  exception.each_error { |error| say_error error, :with_exit => false }
49
+ rescue Client::ConflictException => e
50
+ say_error e[:message]
49
51
  end
50
52
 
51
53
  desc 'finish', 'Finish last maintenance'
@@ -55,6 +57,8 @@ module Shelly
55
57
  say "Maintenance has been finished", :green
56
58
  rescue Client::ValidationException => exception
57
59
  exception.each_error { |error| say_error error, :with_exit => false }
60
+ rescue Client::ConflictException => e
61
+ say_error e[:message]
58
62
  end
59
63
  end
60
64
  end
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.36"
2
+ VERSION = "0.4.37"
3
3
  end
@@ -109,17 +109,19 @@ describe Shelly::CLI::Maintenance do
109
109
  context 'because there is another maintenance in progress' do
110
110
  before do
111
111
  body = {
112
- 'message' => 'Validation Failed',
113
- 'errors' => [['base', 'Maintenance already in progress']]
112
+ 'message' => 'Maintenance is already in progress'
114
113
  }
115
- exception = Shelly::Client::ValidationException.new(body)
114
+ exception = Shelly::Client::ConflictException.new(body)
116
115
  client.stub(:start_maintenance).and_raise(exception)
117
116
  end
118
117
 
119
118
  it 'should print error message' do
120
119
  $stdout.should_receive(:puts).
121
- with(red 'Maintenance already in progress')
122
- invoke(cli, :start)
120
+ with(red 'Maintenance is already in progress')
121
+
122
+ lambda {
123
+ invoke(cli, :start)
124
+ }.should raise_error(SystemExit)
123
125
  end
124
126
  end
125
127
  end
@@ -141,17 +143,19 @@ describe Shelly::CLI::Maintenance do
141
143
  context 'because there is no maintenances in progress' do
142
144
  before do
143
145
  body = {
144
- 'message' => 'Validation Failed',
145
- 'errors' => [['base', 'There is no maintenances in progress']]
146
+ 'message' => 'There is no maintenance events in progress'
146
147
  }
147
- exception = Shelly::Client::ValidationException.new(body)
148
+ exception = Shelly::Client::ConflictException.new(body)
148
149
  client.stub(:finish_maintenance).and_raise(exception)
149
150
  end
150
151
 
151
152
  it 'should print error message' do
152
153
  $stdout.should_receive(:puts).
153
- with(red 'There is no maintenances in progress')
154
- invoke(cli, :finish)
154
+ with(red 'There is no maintenance events in progress')
155
+
156
+ lambda {
157
+ invoke(cli, :finish)
158
+ }.should raise_error(SystemExit)
155
159
  end
156
160
  end
157
161
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.36
4
+ version: 0.4.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shelly Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec