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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/crowbar/client/app/backup.rb +4 -4
- data/lib/crowbar/client/app/batch.rb +3 -3
- data/lib/crowbar/client/command/batch/build.rb +1 -1
- data/lib/crowbar/client/command/batch/export.rb +13 -6
- data/lib/crowbar/client/request/batch/export.rb +0 -7
- data/lib/crowbar/client/request/installer/start.rb +1 -0
- data/lib/crowbar/client/request/installer/status.rb +1 -0
- data/lib/crowbar/client/version.rb +1 -1
- data/spec/crowbar/client/request/batch/build_spec.rb +1 -1
- data/spec/crowbar/client/request/batch/export_spec.rb +2 -2
- data/spec/crowbar/client/request/installer/start_spec.rb +1 -1
- data/spec/crowbar/client/request/installer/status_spec.rb +1 -1
- data/spec/fixtures/batch.yml +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b636e56d83e9730ca3c0673c16bf3b224da00b
|
4
|
+
data.tar.gz: c0890e422cedfaae4323992edbbddecea89227da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff7ebe7f47b711872f134a1741a4219469efbb88eab2dd6935ce76ab13bf5f05061693e540312aab02f1fee700ca23e5ab6e88c8d6f5eccaa462c9dab897c13f
|
7
|
+
data.tar.gz: 38d95910370053dc116d07355c75c30bd8b66e7d6f55af623115983d5bc91ca02db27408a11967046f44b8fe3d588ed1717850c893fc4ebc4e7d8d7b0dcbea2b
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
@@ -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.
|
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.
|
54
|
-
|
54
|
+
path(body["name"]).tap do |path|
|
55
|
+
path.binmode
|
56
|
+
path.write(
|
57
|
+
Base64.decode64(
|
58
|
+
body["file"]
|
59
|
+
)
|
60
|
+
)
|
55
61
|
|
56
|
-
|
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
|
@@ -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" => "
|
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/
|
49
|
-
"Accept" => "application/
|
48
|
+
"Content-Type" => "application/json",
|
49
|
+
"Accept" => "application/json"
|
50
50
|
}
|
51
51
|
end
|
52
52
|
end
|
data/spec/fixtures/batch.yml
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|