crowbar-client 3.1.5 → 3.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b52f82374a184794b7a9d44dfd87ff5f775b7947
4
- data.tar.gz: 280a86b9d621c85687fb9126e4fe77e40677845f
3
+ metadata.gz: db7753c52a0bdc07da4e50d90b7b14db6b31c165
4
+ data.tar.gz: c7ba06a39fe3368164264435f6f98c5ee364c162
5
5
  SHA512:
6
- metadata.gz: 89ddab179dba573d99a7adfdcc6ebfa004cc30f9dd8334f4669fa501eca0853e9654bb68d61aad2b32d7333427b2631540daa52b6f00e6e2bee7cae1a3520d04
7
- data.tar.gz: 8b2b59b6d16ed7d629a881452356be3bbab3f5d62a9203360ce13a9ffbd621daf67778e24e6b5ce046281409d6b11f8098b013703be9e4619ebb8915421e4e44
6
+ metadata.gz: 830a4bcb1d6276fc62d4c9d3f4a031ff4d59f64736befeaa626038f3fb4ef1efe34cbc7ed2e6bd792f427ec44af37f3ac52864dfd36ad2e7846e9c708c7c3194
7
+ data.tar.gz: 17811f67aeef2e2334e2388136eb0e2ad1d4e52dcc49fb0e429f5056504c00be3c6a1b7bbef25b6e38055458ed63b81a0a5602b26b77fb38686a86312cbd626c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.6](https://github.com/crowbar/crowbar-client/releases/tag/v3.1.6) - 2017-01-05
4
+
5
+ * BUGFIX
6
+ * Catch error 406 when node alias is not unique (bsc#1011581) (@MaximilianMeister)
7
+ * Use cancel not prepare (@MaximilianMeister)
8
+ * ENHANCEMENT
9
+ * Adapt http codes for upgrade cancel (@MaximilianMeister)
10
+ * Add SimpleError mixxin (@rsalevsky)
11
+ * Schema migration is included in the crowbar-init step now (@MaximilianMeister)
12
+ * Change endpoint of the openstack backup (@MaximilianMeister)
13
+
3
14
  ## [3.1.5](https://github.com/crowbar/crowbar-client/releases/tag/v3.1.5) - 2016-12-06
4
15
 
5
16
  * BUGFIX
@@ -373,7 +373,7 @@ module Crowbar
373
373
  LONGDESC
374
374
 
375
375
  def cancel
376
- Command::Upgrade::Prepare.new(
376
+ Command::Upgrade::Cancel.new(
377
377
  *command_params
378
378
  ).execute
379
379
  rescue => e
@@ -35,6 +35,8 @@ module Crowbar
35
35
  say "Successfully updated alias for #{args.name}"
36
36
  when 404
37
37
  err "Node does not exist"
38
+ when 406
39
+ err "Rename for #{args.name} failed. Node alias not unique?"
38
40
  else
39
41
  err request.parsed_response["error"]
40
42
  end
@@ -22,6 +22,7 @@ module Crowbar
22
22
  # Implementation for the proposal reset command
23
23
  #
24
24
  class Reset < Base
25
+ include Mixin::SimpleError
25
26
  include Mixin::Barclamp
26
27
 
27
28
  def request
@@ -40,7 +41,9 @@ module Crowbar
40
41
  when 404
41
42
  say "Proposal does not exist"
42
43
  else
43
- err request.parsed_response["error"]
44
+ err format_error(
45
+ request.parsed_response["error"]
46
+ )
44
47
  end
45
48
  end
46
49
  end
@@ -33,8 +33,10 @@ module Crowbar
33
33
  case request.code
34
34
  when 200
35
35
  say "Canceled the upgrade process"
36
- when 406
37
- err "Not allowed to cancel the upgrade at this stage; Please refer to help output."
36
+ when 422
37
+ err "Failed to cancel the upgrade process"
38
+ when 423
39
+ err "Not possible to cancel the upgrade at this stage; Please refer to help output."
38
40
  else
39
41
  err request.parsed_response["error"]
40
42
  end
@@ -67,7 +67,6 @@ module Crowbar
67
67
  {
68
68
  database_setup: "Setup the Crowbar database",
69
69
  database_migration: "Migrate the Crowbar database",
70
- schema_migration: "Migrate the schemas",
71
70
  crowbar_init: "Initialize Crowbar"
72
71
  }
73
72
  end
@@ -34,6 +34,9 @@ module Crowbar
34
34
 
35
35
  autoload :UpgradeError,
36
36
  File.expand_path("../mixin/upgrade_error", __FILE__)
37
+
38
+ autoload :SimpleError,
39
+ File.expand_path("../mixin/simple_error", __FILE__)
37
40
  end
38
41
  end
39
42
  end
@@ -0,0 +1,38 @@
1
+ #
2
+ # Copyright 2016, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require "active_support/concern"
18
+
19
+ module Crowbar
20
+ module Client
21
+ module Mixin
22
+ #
23
+ # A mixin with error related helpers
24
+ #
25
+ module SimpleError
26
+ extend ActiveSupport::Concern
27
+
28
+ included do
29
+ def format_error(response)
30
+ JSON.parse(response.body)["error"]
31
+ rescue
32
+ "Unable to format error response"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -73,8 +73,8 @@ module Crowbar
73
73
  when "openstack"
74
74
  [
75
75
  "api",
76
- "openstack",
77
- "backup"
76
+ "upgrade",
77
+ "openstackbackup"
78
78
  ].join("/")
79
79
  end
80
80
  end
@@ -33,7 +33,7 @@ module Crowbar
33
33
  #
34
34
  # Patch version
35
35
  #
36
- PATCH = 5
36
+ PATCH = 6
37
37
 
38
38
  #
39
39
  # Optional suffix
@@ -40,7 +40,7 @@ describe "Crowbar::Client::Request::Upgrade::Backup" do
40
40
  end
41
41
 
42
42
  let!(:url) do
43
- "api/openstack/backup"
43
+ "api/upgrade/openstackbackup"
44
44
  end
45
45
 
46
46
  let!(:headers) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowbar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Boerger
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-06 00:00:00.000000000 Z
13
+ date: 2017-01-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -345,6 +345,7 @@ files:
345
345
  - lib/crowbar/client/mixin/database.rb
346
346
  - lib/crowbar/client/mixin/filter.rb
347
347
  - lib/crowbar/client/mixin/format.rb
348
+ - lib/crowbar/client/mixin/simple_error.rb
348
349
  - lib/crowbar/client/mixin/upgrade_error.rb
349
350
  - lib/crowbar/client/request.rb
350
351
  - lib/crowbar/client/request/backup.rb