bosh_cli 1.2697.0 → 1.2707.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cli/changeset_helper.rb +5 -5
- data/lib/cli/client/director.rb +8 -8
- data/lib/cli/commands/deployment.rb +9 -7
- data/lib/cli/deployment_helper.rb +41 -36
- data/lib/cli/deployment_manifest.rb +2 -2
- data/lib/cli/version.rb +1 -1
- metadata +9 -10
- data/README +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a47c8ce74bce4953701eef1707ae6ad0a8c1610
|
4
|
+
data.tar.gz: 89fcf0da09e7d6f9458c5930536473ca0cd92388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bba4b12fa020695185b658a001793b789834c558860ec9474e5554da42b112951e2438a03fff01e76ef4e0ce0ee6c9bfc700d408fcf2496fbacc17b52083dbf0
|
7
|
+
data.tar.gz: 797d866bf4e07d239294a66815665069c081c5b1f37664b5249dea58de7d9a4857f644614cc4402186ab49ee046ff28dbe2e3dd5d6f74b3e78de798592dafac9
|
data/lib/cli/changeset_helper.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: UTF-8
|
2
2
|
|
3
3
|
module Bosh::Cli
|
4
4
|
class HashChangeset
|
@@ -50,7 +50,7 @@ module Bosh::Cli
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def summary(level = 0)
|
53
|
-
indent =
|
53
|
+
indent = ' ' * level
|
54
54
|
out = []
|
55
55
|
|
56
56
|
@children.each_pair do |k, v|
|
@@ -61,11 +61,11 @@ module Bosh::Cli
|
|
61
61
|
elsif v.leaf?
|
62
62
|
case v.state
|
63
63
|
when :added
|
64
|
-
out << indent + "
|
64
|
+
out << indent + "+ #{k}: ".make_yellow + v.new.to_s
|
65
65
|
when :removed
|
66
|
-
out << indent + "
|
66
|
+
out << indent + "- #{k}: ".make_red + v.old.to_s
|
67
67
|
when :changed
|
68
|
-
out << indent + "
|
68
|
+
out << indent + "± #{k}: ".make_yellow
|
69
69
|
out << diff(v.old, v.new, indent + " ")
|
70
70
|
end
|
71
71
|
else
|
data/lib/cli/client/director.rb
CHANGED
@@ -122,13 +122,7 @@ module Bosh
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def list_running_tasks(verbose = 1)
|
125
|
-
|
126
|
-
if Bosh::Common::Version::BoshVersion.parse(get_version) < Bosh::Common::Version::BoshVersion.parse('0.3.5')
|
127
|
-
get_json('/tasks?state=processing')
|
128
|
-
else
|
129
|
-
get_json('/tasks?state=processing,cancelling,queued' +
|
130
|
-
"&verbose=#{verbose}")
|
131
|
-
end
|
125
|
+
get_json("/tasks?state=processing,cancelling,queued&verbose=#{verbose}")
|
132
126
|
end
|
133
127
|
|
134
128
|
def list_recent_tasks(count = 30, verbose = 1)
|
@@ -700,7 +694,13 @@ module Bosh
|
|
700
694
|
:header => headers,
|
701
695
|
}, &block)
|
702
696
|
|
703
|
-
rescue URI::Error,
|
697
|
+
rescue URI::Error,
|
698
|
+
SocketError,
|
699
|
+
Errno::ECONNREFUSED,
|
700
|
+
Timeout::Error,
|
701
|
+
HTTPClient::TimeoutError,
|
702
|
+
HTTPClient::KeepAliveDisconnected,
|
703
|
+
OpenSSL::SSL::SSLError => e
|
704
704
|
raise DirectorInaccessible, "cannot access director (#{e.message})"
|
705
705
|
|
706
706
|
rescue HTTPClient::BadResponseError => e
|
@@ -88,20 +88,22 @@ module Bosh::Cli::Command
|
|
88
88
|
manifest_yaml = prepare_deployment_manifest(
|
89
89
|
:yaml => true, :resolve_properties => true)
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
inspect_deployment_changes(Psych.load(manifest_yaml), interactive: interactive?)
|
92
|
+
say('Please review all changes carefully'.make_yellow) if interactive?
|
93
|
+
|
94
|
+
deployment_name = File.basename(deployment)
|
95
95
|
|
96
|
-
|
96
|
+
header('Deploying')
|
97
|
+
say("Deployment name: `#{deployment_name.make_green}'")
|
98
|
+
say("Director name: `#{target_name.make_green}'")
|
97
99
|
|
98
|
-
unless confirmed?(
|
100
|
+
unless confirmed?('Are you sure you want to deploy?')
|
99
101
|
cancel_deployment
|
100
102
|
end
|
101
103
|
|
102
104
|
status, task_id = director.deploy(manifest_yaml, :recreate => recreate)
|
103
105
|
|
104
|
-
task_report(status, task_id, "Deployed
|
106
|
+
task_report(status, task_id, "Deployed `#{deployment_name.make_green}' to `#{target_name.make_green}'")
|
105
107
|
end
|
106
108
|
|
107
109
|
# bosh delete deployment
|
@@ -8,6 +8,8 @@ module Bosh::Cli
|
|
8
8
|
err("Cannot find deployment manifest in `#{manifest_filename}'")
|
9
9
|
end
|
10
10
|
|
11
|
+
header('Processing deployment manifest')
|
12
|
+
|
11
13
|
manifest = load_yaml_file(manifest_filename)
|
12
14
|
manifest_yaml = File.read(manifest_filename)
|
13
15
|
|
@@ -89,11 +91,8 @@ module Bosh::Cli
|
|
89
91
|
# a meaningful return value.
|
90
92
|
# @return Boolean Were there any changes in deployment manifest?
|
91
93
|
def inspect_deployment_changes(manifest, options = {})
|
92
|
-
show_empty_changeset = true
|
93
|
-
|
94
|
-
if options.has_key?(:show_empty_changeset)
|
95
|
-
show_empty_changeset = options[:show_empty_changeset]
|
96
|
-
end
|
94
|
+
show_empty_changeset = options.fetch(:show_empty_changeset, true)
|
95
|
+
interactive = options.fetch(:interactive, false)
|
97
96
|
|
98
97
|
manifest = manifest.dup
|
99
98
|
current_deployment = director.get_deployment(manifest['name'])
|
@@ -106,8 +105,7 @@ module Bosh::Cli
|
|
106
105
|
current_manifest = Psych.load(current_deployment['manifest'])
|
107
106
|
|
108
107
|
unless current_manifest.is_a?(Hash)
|
109
|
-
err('Current deployment manifest format is invalid, '
|
110
|
-
'check if director works properly')
|
108
|
+
err('Current deployment manifest format is invalid, check if director works properly')
|
111
109
|
end
|
112
110
|
|
113
111
|
diff = Bosh::Cli::HashChangeset.new
|
@@ -115,8 +113,7 @@ module Bosh::Cli
|
|
115
113
|
diff.add_hash(normalize_deployment_manifest(current_manifest), :old)
|
116
114
|
@_diff_key_visited = { 'name' => 1, 'director_uuid' => 1 }
|
117
115
|
|
118
|
-
|
119
|
-
nl
|
116
|
+
header('Detecting deployment changes')
|
120
117
|
|
121
118
|
if !diff.changed? && !show_empty_changeset
|
122
119
|
return false
|
@@ -124,14 +121,16 @@ module Bosh::Cli
|
|
124
121
|
|
125
122
|
if diff[:release]
|
126
123
|
print_summary(diff, :release)
|
127
|
-
warn_about_release_changes(diff[:release])
|
124
|
+
warn_about_release_changes(diff[:release]) if interactive
|
128
125
|
nl
|
129
126
|
end
|
130
127
|
|
131
128
|
if diff[:releases]
|
132
129
|
print_summary(diff, :releases)
|
133
|
-
|
134
|
-
|
130
|
+
if interactive
|
131
|
+
diff[:releases].each do |release_diff|
|
132
|
+
warn_about_release_changes(release_diff)
|
133
|
+
end
|
135
134
|
end
|
136
135
|
nl
|
137
136
|
end
|
@@ -143,7 +142,35 @@ module Bosh::Cli
|
|
143
142
|
nl
|
144
143
|
|
145
144
|
print_summary(diff, :resource_pools)
|
145
|
+
warn_about_stemcell_changes(diff) if interactive
|
146
|
+
nl
|
147
|
+
|
148
|
+
print_summary(diff, :disk_pools)
|
149
|
+
nl
|
150
|
+
|
151
|
+
print_summary(diff, :networks)
|
152
|
+
nl
|
153
|
+
|
154
|
+
print_summary(diff, :jobs)
|
155
|
+
nl
|
156
|
+
|
157
|
+
print_summary(diff, :properties)
|
158
|
+
nl
|
159
|
+
|
160
|
+
diff.keys.each do |key|
|
161
|
+
unless @_diff_key_visited[key]
|
162
|
+
print_summary(diff, key)
|
163
|
+
nl
|
164
|
+
end
|
165
|
+
end
|
146
166
|
|
167
|
+
diff.changed?
|
168
|
+
rescue Bosh::Cli::ResourceNotFound
|
169
|
+
say('Cannot get current deployment information from director, possibly a new deployment'.make_red)
|
170
|
+
true
|
171
|
+
end
|
172
|
+
|
173
|
+
def warn_about_stemcell_changes(diff)
|
147
174
|
old_stemcells = Set.new
|
148
175
|
new_stemcells = Set.new
|
149
176
|
|
@@ -159,40 +186,18 @@ module Bosh::Cli
|
|
159
186
|
end
|
160
187
|
|
161
188
|
if old_stemcells != new_stemcells
|
162
|
-
unless confirmed?('Stemcell update has been detected. '
|
163
|
-
'Are you sure you want to update stemcells?')
|
189
|
+
unless confirmed?('Stemcell update has been detected. Are you sure you want to update stemcells?')
|
164
190
|
cancel_deployment
|
165
191
|
end
|
166
192
|
end
|
167
193
|
|
168
194
|
if old_stemcells.size != new_stemcells.size
|
169
195
|
say('Stemcell update seems to be inconsistent with current '.make_red +
|
170
|
-
|
196
|
+
'deployment. Please carefully review changes above.'.make_red)
|
171
197
|
unless confirmed?('Are you sure this configuration is correct?')
|
172
198
|
cancel_deployment
|
173
199
|
end
|
174
200
|
end
|
175
|
-
|
176
|
-
nl
|
177
|
-
print_summary(diff, :networks)
|
178
|
-
nl
|
179
|
-
print_summary(diff, :jobs)
|
180
|
-
nl
|
181
|
-
print_summary(diff, :properties)
|
182
|
-
nl
|
183
|
-
|
184
|
-
diff.keys.each do |key|
|
185
|
-
unless @_diff_key_visited[key]
|
186
|
-
print_summary(diff, key)
|
187
|
-
nl
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
diff.changed?
|
192
|
-
rescue Bosh::Cli::ResourceNotFound
|
193
|
-
say('Cannot get current deployment information from director, ' +
|
194
|
-
'possibly a new deployment'.make_red)
|
195
|
-
true
|
196
201
|
end
|
197
202
|
|
198
203
|
def latest_release_versions
|
@@ -9,7 +9,7 @@ module Bosh::Cli
|
|
9
9
|
def normalize
|
10
10
|
normalized = Bosh::Common::DeepCopy.copy(manifest_hash)
|
11
11
|
|
12
|
-
%w(releases networks jobs resource_pools).each do |section|
|
12
|
+
%w(releases networks jobs resource_pools disk_pools).each do |section|
|
13
13
|
normalized[section] ||= []
|
14
14
|
|
15
15
|
unless normalized[section].kind_of?(Array)
|
@@ -63,4 +63,4 @@ module Bosh::Cli
|
|
63
63
|
err("Deployment manifest error: #{err}")
|
64
64
|
end
|
65
65
|
end
|
66
|
-
end
|
66
|
+
end
|
data/lib/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2707.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2707.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2707.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bosh-template
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.2707.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.2707.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json_pure
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.2707.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.2707.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: net-ssh
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,14 +194,13 @@ dependencies:
|
|
194
194
|
version: 0.5.4
|
195
195
|
description: |-
|
196
196
|
BOSH CLI
|
197
|
-
|
197
|
+
3e8bee
|
198
198
|
email: support@cloudfoundry.com
|
199
199
|
executables:
|
200
200
|
- bosh
|
201
201
|
extensions: []
|
202
202
|
extra_rdoc_files: []
|
203
203
|
files:
|
204
|
-
- README
|
205
204
|
- bin/bosh
|
206
205
|
- lib/cli.rb
|
207
206
|
- lib/cli/backup_destination_path.rb
|
data/README
DELETED