bosh_cli 0.19.1 → 0.19.2
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.
- data/lib/cli/commands/base.rb +37 -0
- data/lib/cli/commands/cloudcheck.rb +13 -29
- data/lib/cli/commands/deployment.rb +6 -27
- data/lib/cli/commands/job_management.rb +12 -17
- data/lib/cli/commands/job_rename.rb +29 -34
- data/lib/cli/commands/log_management.rb +1 -0
- data/lib/cli/commands/maintenance.rb +2 -2
- data/lib/cli/commands/misc.rb +6 -6
- data/lib/cli/commands/release.rb +33 -34
- data/lib/cli/commands/ssh.rb +4 -3
- data/lib/cli/commands/stemcell.rb +9 -29
- data/lib/cli/config.rb +2 -2
- data/lib/cli/core_ext.rb +4 -1
- data/lib/cli/deployment_helper.rb +1 -1
- data/lib/cli/director.rb +159 -73
- data/lib/cli/event_log_renderer.rb +49 -13
- data/lib/cli/release_compiler.rb +6 -9
- data/lib/cli/release_tarball.rb +10 -5
- data/lib/cli/runner.rb +36 -1
- data/lib/cli/task_log_renderer.rb +1 -1
- data/lib/cli/task_tracker.rb +13 -6
- data/lib/cli/version.rb +1 -1
- data/spec/unit/core_ext_spec.rb +5 -1
- data/spec/unit/director_spec.rb +40 -23
- data/spec/unit/job_rename_spec.rb +4 -0
- data/spec/unit/release_tarball_spec.rb +3 -1
- data/spec/unit/runner_spec.rb +20 -0
- data/spec/unit/task_tracker_spec.rb +0 -27
- metadata +4 -4
@@ -4,6 +4,9 @@ require "spec_helper"
|
|
4
4
|
|
5
5
|
describe Bosh::Cli::Command::Base do
|
6
6
|
|
7
|
+
# TODO: this spec is not in line with the rest of them: it's testing command,
|
8
|
+
# not the rename behavior. Logic should probably be extracted into JobRenamer
|
9
|
+
# or something like that.
|
7
10
|
describe Bosh::Cli::Command::JobRename do
|
8
11
|
it "should rename the job" do
|
9
12
|
mock_director = mock(Object)
|
@@ -11,6 +14,7 @@ describe Bosh::Cli::Command::Base do
|
|
11
14
|
Bosh::Cli::Director.should_receive(:new).and_return(mock_director)
|
12
15
|
|
13
16
|
job_rename = Bosh::Cli::Command::JobRename.new
|
17
|
+
job_rename.stub(:confirmed?).and_return(true)
|
14
18
|
job_rename.stub(:auth_required)
|
15
19
|
job_rename.stub(:prepare_deployment_manifest).and_return(old_manifest_yaml)
|
16
20
|
job_rename.stub(:sanity_check_job_rename)
|
@@ -17,7 +17,9 @@ describe Bosh::Cli::ReleaseTarball do
|
|
17
17
|
"jobs" => [{ "name" => "cacher", "version" => "1" },
|
18
18
|
{ "name" => "sweeper", "version" => "1" }]
|
19
19
|
}
|
20
|
-
|
20
|
+
remote_packages_sha1 = ["86bd8b15562cde007f030a303fa64779af5fa4e7"]
|
21
|
+
repacked_tarball_path = tarball.repack(remote_release["jobs"],
|
22
|
+
remote_packages_sha1)
|
21
23
|
|
22
24
|
tarball.skipped.should == 2
|
23
25
|
|
data/spec/unit/runner_spec.rb
CHANGED
@@ -117,4 +117,24 @@ describe Bosh::Cli::Runner do
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
describe "command completion" do
|
121
|
+
let(:runner) { r = Bosh::Cli::Runner.new([]); r.prepare; r }
|
122
|
+
|
123
|
+
it "should complete 'cr' to 'create'" do
|
124
|
+
runner.complete("cr").should == %w[create]
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should complete 'create' to 'package, release & user'" do
|
128
|
+
completion = runner.complete("create")
|
129
|
+
completion.should include("package")
|
130
|
+
completion.should include("release")
|
131
|
+
completion.should include("user")
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should complete 'cr' to 'create'" do
|
135
|
+
runner.complete("create u").should == %w[user]
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
120
140
|
end
|
@@ -124,31 +124,4 @@ describe Bosh::Cli::TaskTracker do
|
|
124
124
|
tracker.track.should == :cancelled
|
125
125
|
end
|
126
126
|
|
127
|
-
it "prompts for task error log on error (if in interactive mode)" do
|
128
|
-
tracker = make_tracker("42", { :log_type => "event",
|
129
|
-
:use_cache => false })
|
130
|
-
|
131
|
-
tracker.stub!(:interactive?).and_return(true)
|
132
|
-
|
133
|
-
@director.should_receive(:get_task_state).with("42").
|
134
|
-
and_return("processing", "error")
|
135
|
-
|
136
|
-
@director.should_receive(:get_task_output).with("42", 0, "event").
|
137
|
-
and_return(["", nil])
|
138
|
-
|
139
|
-
@director.should_receive(:get_task_output).with("42", 0, "event").
|
140
|
-
and_return(["foo", 4])
|
141
|
-
|
142
|
-
tracker.should_receive(:ask).and_return("yes")
|
143
|
-
|
144
|
-
new_tracker = mock("tracker")
|
145
|
-
Bosh::Cli::TaskTracker.should_receive(:new).
|
146
|
-
with(@director, "42", { :log_type => "debug", :use_cache => false }).
|
147
|
-
and_return(new_tracker)
|
148
|
-
|
149
|
-
new_tracker.should_receive(:track).and_return(:foo)
|
150
|
-
|
151
|
-
tracker.track.should == :error
|
152
|
-
end
|
153
|
-
|
154
127
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|
@@ -317,7 +317,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
317
317
|
version: '0'
|
318
318
|
segments:
|
319
319
|
- 0
|
320
|
-
hash: -
|
320
|
+
hash: -1152730120913906678
|
321
321
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
322
322
|
none: false
|
323
323
|
requirements:
|
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
326
|
version: '0'
|
327
327
|
segments:
|
328
328
|
- 0
|
329
|
-
hash: -
|
329
|
+
hash: -1152730120913906678
|
330
330
|
requirements: []
|
331
331
|
rubyforge_project:
|
332
332
|
rubygems_version: 1.8.23
|