crowbar-client 2.4.0 → 2.4.1

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: ad1e74fd43f734f1de83365be861088e5fe578f3
4
- data.tar.gz: 7227247e2f6d0650fbaaa3a4ee94e3560f16324b
3
+ metadata.gz: e4b636e56d83e9730ca3c0673c16bf3b224da00b
4
+ data.tar.gz: c0890e422cedfaae4323992edbbddecea89227da
5
5
  SHA512:
6
- metadata.gz: 48598a6ec995593fc838e7a5dfa08a476605445fb7fc0d2d6f643e1ab88b73d812b1c8e07ebc546305d72db39cdbfbeeabf2019f4c87ea38ed432b3c6079cf0d
7
- data.tar.gz: 0deaf315129041b3fdd4209734324170476de4a6bb9b21324d6c525f957d781d7c37a2cbaa81d539e3555674b7f781e224d391ae41714343596b09e1e39bf34e
6
+ metadata.gz: ff7ebe7f47b711872f134a1741a4219469efbb88eab2dd6935ce76ab13bf5f05061693e540312aab02f1fee700ca23e5ab6e88c8d6f5eccaa462c9dab897c13f
7
+ data.tar.gz: 38d95910370053dc116d07355c75c30bd8b66e7d6f55af623115983d5bc91ca02db27408a11967046f44b8fe3d588ed1717850c893fc4ebc4e7d8d7b0dcbea2b
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.1](https://github.com/crowbar/crowbar-client/releases/tag/v2.4.1) - 2015-02-08
4
+
5
+ * BUGFIX
6
+ * Fixed updated path to installer API (@jdsn)
7
+ * Print correct help output for backup commands (@tboerger)
8
+ * ENHANCEMENT
9
+ * Integrated changes for fixed batch API (@tboerger)
10
+
3
11
  ## [2.4.0](https://github.com/crowbar/crowbar-client/releases/tag/v2.4.0) - 2015-01-27
4
12
 
5
13
  * BUGFIX
@@ -106,7 +106,7 @@ module Crowbar
106
106
  catch_errors(e)
107
107
  end
108
108
 
109
- desc "create",
109
+ desc "create NAME",
110
110
  "Create a new backup"
111
111
 
112
112
  long_desc <<-LONGDESC
@@ -125,7 +125,7 @@ module Crowbar
125
125
  catch_errors(e)
126
126
  end
127
127
 
128
- desc "delete",
128
+ desc "delete NAME",
129
129
  "Delete a backup"
130
130
 
131
131
  long_desc <<-LONGDESC
@@ -144,7 +144,7 @@ module Crowbar
144
144
  catch_errors(e)
145
145
  end
146
146
 
147
- desc "upload",
147
+ desc "upload FILE",
148
148
  "Upload a backup"
149
149
 
150
150
  long_desc <<-LONGDESC
@@ -162,7 +162,7 @@ module Crowbar
162
162
  catch_errors(e)
163
163
  end
164
164
 
165
- desc "download",
165
+ desc "download NAME [FILE]",
166
166
  "Download a backup"
167
167
 
168
168
  long_desc <<-LONGDESC
@@ -63,11 +63,11 @@ module Crowbar
63
63
  catch_errors(e)
64
64
  end
65
65
 
66
- desc "export FILE",
66
+ desc "export [FILE]",
67
67
  "Export proposals to file or stdout"
68
68
 
69
69
  long_desc <<-LONGDESC
70
- `export FILE` will collect the informations of the proposals
70
+ `export [FILE]` will collect the information of the proposals
71
71
  in a YAML format. You can directly provide a path to a file or
72
72
  just pipe the content into stdout. To pipe the content to
73
73
  stdout you should just write a `-` instead of a specific
@@ -98,7 +98,7 @@ module Crowbar
98
98
  banner: "BARCLAMP[.PROPOSAL]",
99
99
  desc: "Exclude a specific barclamp or proposal for export"
100
100
 
101
- def export(file)
101
+ def export(file = nil)
102
102
  Command::Batch::Export.new(
103
103
  *command_params(
104
104
  file: file
@@ -51,7 +51,7 @@ module Crowbar
51
51
  when 200
52
52
  say "Successfully built batch"
53
53
  else
54
- err request.body
54
+ err request.parsed_response["error"]
55
55
  end
56
56
  end
57
57
  end
@@ -14,6 +14,7 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
+ require "base64"
17
18
  require "easy_diff"
18
19
 
19
20
  module Crowbar
@@ -36,7 +37,7 @@ module Crowbar
36
37
  request.process do |request|
37
38
  case request.code
38
39
  when 200
39
- if write(request.body)
40
+ if write(request.parsed_response)
40
41
  say "Successfully exported batch"
41
42
  else
42
43
  err "Failed to export batch"
@@ -50,15 +51,21 @@ module Crowbar
50
51
  protected
51
52
 
52
53
  def write(body)
53
- path.binmode
54
- path.write body
54
+ path(body["name"]).tap do |path|
55
+ path.binmode
56
+ path.write(
57
+ Base64.decode64(
58
+ body["file"]
59
+ )
60
+ )
55
61
 
56
- true
62
+ true
63
+ end
57
64
  rescue
58
65
  false
59
66
  end
60
67
 
61
- def path
68
+ def path(name = nil)
62
69
  @path ||=
63
70
  case args.file
64
71
  when "-"
@@ -67,7 +74,7 @@ module Crowbar
67
74
  args.file
68
75
  else
69
76
  File.new(
70
- args.file,
77
+ args.file || name,
71
78
  File::CREAT | File::TRUNC | File::RDWR
72
79
  )
73
80
  end
@@ -28,13 +28,6 @@ module Crowbar
28
28
  )
29
29
  end
30
30
 
31
- def headers
32
- super.easy_merge!(
33
- "Content-Type" => "application/octet-stream",
34
- "Accept" => "application/octet-stream"
35
- )
36
- end
37
-
38
31
  def method
39
32
  :post
40
33
  end
@@ -33,6 +33,7 @@ module Crowbar
33
33
 
34
34
  def url
35
35
  [
36
+ "installer",
36
37
  "installer",
37
38
  "start"
38
39
  ].join("/")
@@ -25,6 +25,7 @@ module Crowbar
25
25
 
26
26
  def url
27
27
  [
28
+ "installer",
28
29
  "installer",
29
30
  "status"
30
31
  ].join("/")
@@ -19,7 +19,7 @@ module Crowbar
19
19
  class Version
20
20
  MAJOR = 2
21
21
  MINOR = 4
22
- PATCH = 0
22
+ PATCH = 1
23
23
 
24
24
  PRE = nil
25
25
 
@@ -47,7 +47,7 @@ describe "Crowbar::Client::Request::Batch::Build" do
47
47
  let!(:headers) do
48
48
  {
49
49
  "Accept" => "application/json",
50
- "Content-Length" => "403",
50
+ "Content-Length" => "694",
51
51
  "Content-Type" => "multipart/form-data; boundary=-----------RubyMultipartPost"
52
52
  }
53
53
  end
@@ -45,8 +45,8 @@ describe "Crowbar::Client::Request::Batch::Export" do
45
45
 
46
46
  let!(:headers) do
47
47
  {
48
- "Content-Type" => "application/octet-stream",
49
- "Accept" => "application/octet-stream"
48
+ "Content-Type" => "application/json",
49
+ "Accept" => "application/json"
50
50
  }
51
51
  end
52
52
  end
@@ -42,7 +42,7 @@ describe "Crowbar::Client::Request::Installer::Start" do
42
42
  end
43
43
 
44
44
  let!(:url) do
45
- "installer/start"
45
+ "installer/installer/start"
46
46
  end
47
47
 
48
48
  let!(:headers) do
@@ -52,7 +52,7 @@ describe "Crowbar::Client::Request::Installer::Status" do
52
52
  end
53
53
 
54
54
  let!(:url) do
55
- "installer/status"
55
+ "installer/installer/status"
56
56
  end
57
57
 
58
58
  let!(:headers) do
@@ -0,0 +1,14 @@
1
+ proposals:
2
+ - barclamp: provisioner
3
+ attributes:
4
+ shell_prompt: USER@ALIAS:CWD SUFFIX
5
+ - barclamp: database
6
+ deployment:
7
+ elements:
8
+ database-server:
9
+ - "@@controller1@@"
10
+ - barclamp: rabbitmq
11
+ deployment:
12
+ elements:
13
+ rabbitmq-server:
14
+ - "@@controller1@@"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowbar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Boerger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-27 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler