shelly 0.4.16 → 0.4.17
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 +8 -8
- data/CHANGELOG.md +4 -0
- data/lib/shelly/cli/main/add.rb +2 -1
- data/lib/shelly/ssh_key.rb +1 -1
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/main_spec.rb +2 -2
- data/spec/shelly/ssh_key_spec.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTQwZWEzYzYyMjJiMGE4ODE4NWQ0ZjVjY2E3ZGUyYjNmYjg3MGE1Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmI3YWMzMzU0YzE1OGMwZmQyZTFhNDY3ZWM2OWU4YWYxMzVkNDIxNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmM0MDMzMTU2Yzk5ODk3OTE5ZDRiOWYzOWU5MTMzYzVhNDgwODU2ZDA5MDIy
|
10
|
+
MzMzZjU2YzYyMzJhZjFiMzM1OTljODc3ZWI1OGEzYzFlZGU3MGI1NjI1NmNk
|
11
|
+
OGY1Y2Q4OTM1Y2VhNzc3NGNhYjY3Mzg1ZTIwYjhmZmVmNjYyMTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzkwZjU5MGQzMGExMzIzMjRmMWJjZjk0Y2RiODA3NjNhZjgwMzYyZDlkNTBl
|
14
|
+
ZGQ0MjZkMjRiODlmYjM2YTk0NmEyMTZjMzUwOTUyMDNmOTQ0MjJhMTVmYzA4
|
15
|
+
ODAxNWJhODNhYmQ5OTE3Yzg4ZDNkOWY5N2RkNDFjMDc2YWFmOWQ=
|
data/CHANGELOG.md
CHANGED
data/lib/shelly/cli/main/add.rb
CHANGED
@@ -29,6 +29,7 @@ module Shelly
|
|
29
29
|
app.size = options["size"] || "large"
|
30
30
|
app.organization_name = options["organization"] || ask_for_organization(options)
|
31
31
|
app.zone_name = options["zone"]
|
32
|
+
|
32
33
|
app.create
|
33
34
|
say "Cloud '#{app}' created in '#{app.organization_name}' organization", :green
|
34
35
|
say_new_line
|
@@ -59,7 +60,7 @@ module Shelly
|
|
59
60
|
say_error "Fix erros in the below command and type it again to create your cloud" , :with_exit => false
|
60
61
|
say_error "shelly add --code-name=#{app.code_name.downcase.dasherize} --databases=#{app.databases.join(',')} --organization=#{app.organization_name} --size=#{app.size}"
|
61
62
|
rescue Client::ForbiddenException
|
62
|
-
say_error "You have to be the owner of '#{
|
63
|
+
say_error "You have to be the owner of '#{app.organization_name}' organization to add clouds"
|
63
64
|
rescue Client::NotFoundException => e
|
64
65
|
raise unless e.resource == :organization
|
65
66
|
say_error "Organization '#{app.organization_name}' not found", :with_exit => false
|
data/lib/shelly/ssh_key.rb
CHANGED
data/lib/shelly/version.rb
CHANGED
@@ -546,10 +546,10 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
546
546
|
end
|
547
547
|
|
548
548
|
it "should show forbidden exception" do
|
549
|
-
@main.options = {
|
549
|
+
@main.options = {'organization' => "foobar"}
|
550
550
|
exception = Shelly::Client::ForbiddenException.new
|
551
551
|
@app.should_receive(:create).and_raise(exception)
|
552
|
-
$stdout.should_receive(:puts).with(red "You have to be the owner of '
|
552
|
+
$stdout.should_receive(:puts).with(red "You have to be the owner of 'foobar' organization to add clouds")
|
553
553
|
|
554
554
|
expect do
|
555
555
|
fake_stdin(["foooo", "none"]) do
|
data/spec/shelly/ssh_key_spec.rb
CHANGED
@@ -13,10 +13,12 @@ describe Shelly::SshKey do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "#destroy?" do
|
16
|
-
it "should destroy key via API" do
|
16
|
+
it "should destroy key via API if it's uploaded" do
|
17
|
+
@client.should_receive(:ssh_key).with(fingerprint).and_return(true)
|
17
18
|
@client.should_receive(:delete_ssh_key).with(fingerprint)
|
18
19
|
ssh_key.destroy
|
19
20
|
end
|
21
|
+
|
20
22
|
context "key doesn't exist" do
|
21
23
|
it "should not try to destroy it" do
|
22
24
|
FileUtils.rm_rf(ssh_key.path)
|
@@ -24,6 +26,15 @@ describe Shelly::SshKey do
|
|
24
26
|
ssh_key.destroy
|
25
27
|
end
|
26
28
|
end
|
29
|
+
|
30
|
+
context "key isn't uploaded" do
|
31
|
+
it "should not try to destroy it" do
|
32
|
+
@client.should_receive(:ssh_key).with(fingerprint).
|
33
|
+
and_raise(Shelly::Client::NotFoundException.new)
|
34
|
+
@client.should_not_receive(:delete_ssh_key)
|
35
|
+
ssh_key.destroy
|
36
|
+
end
|
37
|
+
end
|
27
38
|
end
|
28
39
|
|
29
40
|
describe "#uploaded?" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shelly Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
type: :development
|