crowbar-client 3.1.2 → 3.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzM0MzhlYmVmYzk2ZjRlMmIyZWM5OTU4MTI3YTk1ZGU1ODJiYWQ5ZA==
4
+ ZDc2MDBlYjg4NzE4YTJiNWY0OWUxN2UyNmRmOWJmZjg5NjBkMjdjMg==
5
5
  data.tar.gz: !binary |-
6
- YjA2YzhlMjFiMTdiMmFlYmM2NTkwOTBiYzI4NTczMTIzMjIyMjlhYQ==
6
+ ZThlYjkwYWRkMmVhOWZjNjMyZGU4OTkwM2JiZDI2N2RkYzE0MDM5MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDNjMTdlMmFmZDdmM2E2MDdhMDQ1NzhkODg3NDRjYjRlODEyYjZkMGNhOTAz
10
- Mzg1ZjFiMTc4MDViYjQ0YmI3M2MxZDhmZWY5ZjZjMDA0NWFhYTU2MTExODdi
11
- ZmQyMzU0NGNmZWQ2MTM4ZWRhMGFjMjUzY2M5YmFlMTBjNDFkY2Y=
9
+ ZTM2NWU3ODU4M2FhY2JjMmU2NTY0ZDM2ZTc4N2JhZDY2ZjNlMjFkYjQ0MWY4
10
+ MzUwNjVlNWY4ZGQwOWU5MmFhZjk4YjIyMDcwMzUxMWUyMTE0ZjhlYzJhOTE2
11
+ YzFiYTNjMDM0OGRkYjg5OGYwMDg2NWI4M2NjMjczNjk5ZTRiNGI=
12
12
  data.tar.gz: !binary |-
13
- NjgxNDY3M2Q3Y2UzNGVmZjBjMDY1YjQ0NGQ0NjE5ODMzOTNlZDliNzMzNTRm
14
- ZjNmOGU1MDQ3MmNlNzQ4Mjk5NjM2NDkwOGUyYzNjY2E4OTBlNjM5ZjdlZDg5
15
- MzJjMDA5ZTBkMjlhZDMyMjllZGNkNTQ0N2YxODQxMTY3NTBkNzc=
13
+ NTAyMzA2ZjBmNTRkMmMzYTZlOTNmOTI3ZWMzMDZiMjM4MzAxYTg2YTNlNzZi
14
+ Mzg3OGE0MjEwYzVlZGYxOTRmODk1ZjA1MzEwMmMzM2VjNzg1YjQ4ZWQzNzQ2
15
+ ODhhMGM1OWE5OWNiOTE5MDQ2OTJkMTU5OTgwMmI4NTRhZGJhNTE=
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.3](https://github.com/crowbar/crowbar-client/releases/tag/v3.1.3) - 2016-10-18
4
+
5
+ * BUGFIX
6
+ * Dont try to parse the body when it could be nil (@MaximilianMeister)
7
+ * ENHANCEMENT
8
+ * Namespace the database setup in the upgrade case (@MaximilianMeister)
9
+ * Restrict the port validation to a max of 65535 (@MaximilianMeister)
10
+ * Adapt urls after moving the repocheck APIs (@MaximilianMeister)
11
+ * Adapt upgrade nodes command to the API (@MaximilianMeister)
12
+
3
13
  ## [3.1.2](https://github.com/crowbar/crowbar-client/releases/tag/v3.1.2) - 2016-09-19
4
14
 
5
15
  * BUGFIX
@@ -173,7 +173,7 @@ module Crowbar
173
173
  "Upgrade Crowbar"
174
174
 
175
175
  long_desc <<-LONGDESC
176
- `crowbar` will upgrade the operating system of the Crowbar server.
176
+ `crowbar` will upgrade the Crowbar server.
177
177
  LONGDESC
178
178
 
179
179
  def crowbar
@@ -184,18 +184,16 @@ module Crowbar
184
184
  catch_errors(e)
185
185
  end
186
186
 
187
- desc "node NODE",
188
- "Upgrade a single node"
187
+ desc "nodes",
188
+ "Trigger the upgrade on all nodes"
189
189
 
190
190
  long_desc <<-LONGDESC
191
- `node NODE` will upgrade the operating system of a single node.
191
+ `nodes` will upgrade all nodes.
192
192
  LONGDESC
193
193
 
194
- def node(node)
195
- Command::Upgrade::Node.new(
196
- *command_params(
197
- node: node
198
- )
194
+ def nodes
195
+ Command::Upgrade::Nodes.new(
196
+ *command_params
199
197
  ).execute
200
198
  rescue => e
201
199
  catch_errors(e)
@@ -303,7 +301,7 @@ module Crowbar
303
301
  desc: "Username for the Crowbar database user
304
302
  Min length: 4
305
303
  Max length: 63
306
- Only alphanumeric characters or underscores
304
+ Only alphanumeric characters and/or underscores
307
305
  Must begin with a letter [a-zA-Z] or underscore"
308
306
 
309
307
  method_option :db_password,
@@ -30,8 +30,8 @@ module Crowbar
30
30
  autoload :Database,
31
31
  File.expand_path("../upgrade/database", __FILE__)
32
32
 
33
- autoload :Node,
34
- File.expand_path("../upgrade/node", __FILE__)
33
+ autoload :Nodes,
34
+ File.expand_path("../upgrade/nodes", __FILE__)
35
35
 
36
36
  autoload :Prechecks,
37
37
  File.expand_path("../upgrade/prechecks", __FILE__)
@@ -46,12 +46,12 @@ module Crowbar
46
46
  validate_params!(args_with_options)
47
47
 
48
48
  request.process do |request|
49
- response = JSON.parse(request.body)
50
-
51
49
  unless request.code == 200
52
50
  err request.parsed_response["error"]
53
51
  end
54
52
 
53
+ response = JSON.parse(request.body)
54
+
55
55
  steps_with_messages.each do |step, message|
56
56
  next if response[step.to_s]["success"]
57
57
  err "Failed to #{message}"
@@ -19,11 +19,11 @@ module Crowbar
19
19
  module Command
20
20
  module Upgrade
21
21
  #
22
- # Implementation for the upgrade node command
22
+ # Implementation for the upgrade nodes command
23
23
  #
24
- class Node < Base
24
+ class Nodes < Base
25
25
  def request
26
- @request ||= Request::Upgrade::Node.new(
26
+ @request ||= Request::Upgrade::Nodes.new(
27
27
  args
28
28
  )
29
29
  end
@@ -32,7 +32,7 @@ module Crowbar
32
32
  request.process do |request|
33
33
  case request.code
34
34
  when 200
35
- say "Successfully triggered node upgrade on #{args.id}"
35
+ say "Successfully triggered the upgrade of the nodes"
36
36
  else
37
37
  err request.parsed_response["error"]
38
38
  end
@@ -30,7 +30,7 @@ module Crowbar
30
30
  REGEX_USERNAME = "(?=^.{4,63}$)(?=^[a-zA-Z0-9_]*$)".freeze
31
31
  REGEX_PASSWORD = "(?=^.{4,63}$)(?=^[a-zA-Z0-9_]*$)(?=[a-zA-Z0-9_$&+,:;=?@#|'<>.^*()%!-]*$)".freeze
32
32
  REGEX_DATABASE = "(?=^.{1,63}$)(?=^[a-zA-Z0-9_]*$)(?=[a-zA-Z0-9_$&+,:;=?@#|'<>.^*()%!-]*$)".freeze
33
- REGEX_PORT = "(?=^.{1,5}$)(?=^[0-9]*$)".freeze
33
+ REGEX_PORT = "(?=^.{1,5}$)(?=^[0-9]*$)(?=^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$)".freeze
34
34
 
35
35
  included do
36
36
  def validate_params!(params)
@@ -30,8 +30,8 @@ module Crowbar
30
30
  autoload :Database,
31
31
  File.expand_path("../upgrade/database", __FILE__)
32
32
 
33
- autoload :Node,
34
- File.expand_path("../upgrade/node", __FILE__)
33
+ autoload :Nodes,
34
+ File.expand_path("../upgrade/nodes", __FILE__)
35
35
 
36
36
  autoload :Prechecks,
37
37
  File.expand_path("../upgrade/prechecks", __FILE__)
@@ -68,11 +68,13 @@ module Crowbar
68
68
  case attrs.mode
69
69
  when "connect"
70
70
  [
71
+ "api",
71
72
  "upgrade",
72
73
  "connect"
73
74
  ].join("/")
74
75
  when "new"
75
76
  [
77
+ "api",
76
78
  "upgrade",
77
79
  "new"
78
80
  ].join("/")
@@ -21,9 +21,9 @@ module Crowbar
21
21
  module Request
22
22
  module Upgrade
23
23
  #
24
- # Implementation for the upgrade node request
24
+ # Implementation for the upgrade nodes request
25
25
  #
26
- class Node < Base
26
+ class Nodes < Base
27
27
  #
28
28
  # Override the request headers
29
29
  #
@@ -35,17 +35,6 @@ module Crowbar
35
35
  )
36
36
  end
37
37
 
38
- #
39
- # Override the request content
40
- #
41
- # @return [Hash] the content for the request
42
- #
43
- def content
44
- super.easy_merge!(
45
- node: attrs.node
46
- )
47
- end
48
-
49
38
  #
50
39
  # HTTP method that gets used by the request
51
40
  #
@@ -63,9 +52,8 @@ module Crowbar
63
52
  def url
64
53
  [
65
54
  "api",
66
- "nodes",
67
- attrs.node,
68
- "upgrade"
55
+ "upgrade",
56
+ "nodes"
69
57
  ].join("/")
70
58
  end
71
59
  end
@@ -54,14 +54,14 @@ module Crowbar
54
54
  when "crowbar"
55
55
  [
56
56
  "api",
57
- "crowbar",
58
- "repocheck"
57
+ "upgrade",
58
+ "adminrepocheck"
59
59
  ].join("/")
60
60
  when "nodes"
61
61
  [
62
62
  "api",
63
63
  "upgrade",
64
- "repocheck"
64
+ "noderepocheck"
65
65
  ].join("/")
66
66
  end
67
67
  end
@@ -33,7 +33,7 @@ module Crowbar
33
33
  #
34
34
  # Patch version
35
35
  #
36
- PATCH = 2
36
+ PATCH = 3
37
37
 
38
38
  #
39
39
  # Optional suffix
@@ -16,16 +16,15 @@
16
16
 
17
17
  require_relative "../../../../spec_helper"
18
18
 
19
- describe "Crowbar::Client::Command::Upgrade::Node" do
19
+ describe "Crowbar::Client::Command::Upgrade::Nodes" do
20
20
  include_context "command_context"
21
21
 
22
22
  it_behaves_like "a command class", true do
23
23
  subject do
24
- ::Crowbar::Client::Command::Upgrade::Node.new(
24
+ ::Crowbar::Client::Command::Upgrade::Nodes.new(
25
25
  stdin,
26
26
  stdout,
27
- stderr,
28
- id: 1
27
+ stderr
29
28
  )
30
29
  end
31
30
  end
@@ -52,7 +52,7 @@ describe "Crowbar::Client::Request::Upgrade::Database" do
52
52
  end
53
53
 
54
54
  let!(:url) do
55
- "upgrade/#{mode}"
55
+ "api/upgrade/#{mode}"
56
56
  end
57
57
 
58
58
  let!(:headers) do
@@ -17,23 +17,21 @@
17
17
 
18
18
  require_relative "../../../../spec_helper"
19
19
 
20
- describe "Crowbar::Client::Request::Upgrade::Node" do
20
+ describe "Crowbar::Client::Request::Upgrade::Nodes" do
21
21
  it_behaves_like "a request class", true do
22
22
  subject do
23
- ::Crowbar::Client::Request::Upgrade::Node.new(
23
+ ::Crowbar::Client::Request::Upgrade::Nodes.new(
24
24
  attrs
25
25
  )
26
26
  end
27
27
 
28
28
  let!(:attrs) do
29
29
  {
30
- node: 1
31
30
  }
32
31
  end
33
32
 
34
33
  let!(:params) do
35
34
  {
36
- node: 1
37
35
  }
38
36
  end
39
37
 
@@ -42,7 +40,7 @@ describe "Crowbar::Client::Request::Upgrade::Node" do
42
40
  end
43
41
 
44
42
  let!(:url) do
45
- "api/nodes/1/upgrade"
43
+ "api/upgrade/nodes"
46
44
  end
47
45
 
48
46
  let!(:headers) do
@@ -18,7 +18,7 @@
18
18
  require_relative "../../../../spec_helper"
19
19
 
20
20
  describe "Crowbar::Client::Request::Upgrade::Repocheck" do
21
- [["crowbar", "crowbar"], ["upgrade", "nodes"]].each do |component|
21
+ [["upgrade/adminrepocheck", "crowbar"], ["upgrade/noderepocheck", "nodes"]].each do |component|
22
22
  it_behaves_like "a request class", true do
23
23
  subject do
24
24
  ::Crowbar::Client::Request::Upgrade::Repocheck.new(
@@ -42,7 +42,7 @@ describe "Crowbar::Client::Request::Upgrade::Repocheck" do
42
42
  end
43
43
 
44
44
  let!(:url) do
45
- "api/#{component.first}/repocheck"
45
+ "api/#{component.first}"
46
46
  end
47
47
 
48
48
  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.2
4
+ version: 3.1.3
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-09-19 00:00:00.000000000 Z
13
+ date: 2016-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -316,7 +316,7 @@ files:
316
316
  - lib/crowbar/client/command/upgrade/backup.rb
317
317
  - lib/crowbar/client/command/upgrade/crowbar.rb
318
318
  - lib/crowbar/client/command/upgrade/database.rb
319
- - lib/crowbar/client/command/upgrade/node.rb
319
+ - lib/crowbar/client/command/upgrade/nodes.rb
320
320
  - lib/crowbar/client/command/upgrade/prechecks.rb
321
321
  - lib/crowbar/client/command/upgrade/prepare.rb
322
322
  - lib/crowbar/client/command/upgrade/repocheck.rb
@@ -411,7 +411,7 @@ files:
411
411
  - lib/crowbar/client/request/upgrade/backup.rb
412
412
  - lib/crowbar/client/request/upgrade/crowbar.rb
413
413
  - lib/crowbar/client/request/upgrade/database.rb
414
- - lib/crowbar/client/request/upgrade/node.rb
414
+ - lib/crowbar/client/request/upgrade/nodes.rb
415
415
  - lib/crowbar/client/request/upgrade/prechecks.rb
416
416
  - lib/crowbar/client/request/upgrade/prepare.rb
417
417
  - lib/crowbar/client/request/upgrade/repocheck.rb
@@ -479,7 +479,7 @@ files:
479
479
  - spec/crowbar/client/command/upgrade/backup_spec.rb
480
480
  - spec/crowbar/client/command/upgrade/crowbar_spec.rb
481
481
  - spec/crowbar/client/command/upgrade/database_spec.rb
482
- - spec/crowbar/client/command/upgrade/node_spec.rb
482
+ - spec/crowbar/client/command/upgrade/nodes_spec.rb
483
483
  - spec/crowbar/client/command/upgrade/prechecks_spec.rb
484
484
  - spec/crowbar/client/command/upgrade/prepare_spec.rb
485
485
  - spec/crowbar/client/command/upgrade/repocheck_spec.rb
@@ -539,7 +539,7 @@ files:
539
539
  - spec/crowbar/client/request/upgrade/backup_spec.rb
540
540
  - spec/crowbar/client/request/upgrade/crowbar_spec.rb
541
541
  - spec/crowbar/client/request/upgrade/database_spec.rb
542
- - spec/crowbar/client/request/upgrade/node_spec.rb
542
+ - spec/crowbar/client/request/upgrade/nodes_spec.rb
543
543
  - spec/crowbar/client/request/upgrade/prechecks_spec.rb
544
544
  - spec/crowbar/client/request/upgrade/prepare_spec.rb
545
545
  - spec/crowbar/client/request/upgrade/repocheck_spec.rb
@@ -636,7 +636,7 @@ test_files:
636
636
  - spec/crowbar/client/command/upgrade/backup_spec.rb
637
637
  - spec/crowbar/client/command/upgrade/crowbar_spec.rb
638
638
  - spec/crowbar/client/command/upgrade/database_spec.rb
639
- - spec/crowbar/client/command/upgrade/node_spec.rb
639
+ - spec/crowbar/client/command/upgrade/nodes_spec.rb
640
640
  - spec/crowbar/client/command/upgrade/prechecks_spec.rb
641
641
  - spec/crowbar/client/command/upgrade/prepare_spec.rb
642
642
  - spec/crowbar/client/command/upgrade/repocheck_spec.rb
@@ -696,7 +696,7 @@ test_files:
696
696
  - spec/crowbar/client/request/upgrade/backup_spec.rb
697
697
  - spec/crowbar/client/request/upgrade/crowbar_spec.rb
698
698
  - spec/crowbar/client/request/upgrade/database_spec.rb
699
- - spec/crowbar/client/request/upgrade/node_spec.rb
699
+ - spec/crowbar/client/request/upgrade/nodes_spec.rb
700
700
  - spec/crowbar/client/request/upgrade/prechecks_spec.rb
701
701
  - spec/crowbar/client/request/upgrade/prepare_spec.rb
702
702
  - spec/crowbar/client/request/upgrade/repocheck_spec.rb