shelly 0.4.16 → 0.4.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjMwYjRkZDhhYjI0ZjI1NTFmNzY1YzkwZjU2YTI4NGUwYWY4NTliOQ==
4
+ OTQwZWEzYzYyMjJiMGE4ODE4NWQ0ZjVjY2E3ZGUyYjNmYjg3MGE1Zg==
5
5
  data.tar.gz: !binary |-
6
- YzdkNDUwYmRlNWYyYzBkOTk4NjBjNGFhY2MyOTllZjYzMzU3NzZlMQ==
6
+ NmI3YWMzMzU0YzE1OGMwZmQyZTFhNDY3ZWM2OWU4YWYxMzVkNDIxNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjA4ZmRmNTE4NjQ1NjA0NGJkZGVmMDEyZjNlMWM0MzVlNDFkYWU1NGFjOGVj
10
- NWFmMTZmYjU4YzJkOTQ1YWU3OGI4YTA1NGE1MGU5NmY5ODM1NmY3YTBmMjc3
11
- NjY1ZDM3NjI1MTExNDUwMDlmYzg0YTk1MGEyZjVjNzNlODJmY2E=
9
+ YmM0MDMzMTU2Yzk5ODk3OTE5ZDRiOWYzOWU5MTMzYzVhNDgwODU2ZDA5MDIy
10
+ MzMzZjU2YzYyMzJhZjFiMzM1OTljODc3ZWI1OGEzYzFlZGU3MGI1NjI1NmNk
11
+ OGY1Y2Q4OTM1Y2VhNzc3NGNhYjY3Mzg1ZTIwYjhmZmVmNjYyMTE=
12
12
  data.tar.gz: !binary |-
13
- ODc0YTAyZWRlZjgwMGIwMzI1ZjJjYTFmMjFmOGZmMmJmOWNkMWI2MDc0Mjk4
14
- ZjJmMDU3NGI5ZmMxODcxNWI5MzM4NTc4MWQ0OGFjNTk0M2YwNTNmYmY3ZGYx
15
- ZTI0ZGExMzg4ZGZhNjZiNTUxNGM3NDJkNWU0Y2QxODExN2U5Y2E=
13
+ YzkwZjU5MGQzMGExMzIzMjRmMWJjZjk0Y2RiODA3NjNhZjgwMzYyZDlkNTBl
14
+ ZGQ0MjZkMjRiODlmYjM2YTk0NmEyMTZjMzUwOTUyMDNmOTQ0MjJhMTVmYzA4
15
+ ODAxNWJhODNhYmQ5OTE3Yzg4ZDNkOWY5N2RkNDFjMDc2YWFmOWQ=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.17 / 2013-12-03
2
+
3
+ * [bugfix] Remove ssh_key from Shelly Cloud only if it was already uploaded
4
+
1
5
  ## 0.4.16 / 2013-11-26
2
6
 
3
7
  * [improvement] Validate kind when importing database backup
@@ -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 '#{options[:organization]}' organization to add clouds"
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
@@ -10,7 +10,7 @@ module Shelly
10
10
  end
11
11
 
12
12
  def destroy
13
- shelly.delete_ssh_key(fingerprint) if exists?
13
+ shelly.delete_ssh_key(fingerprint) if uploaded?
14
14
  end
15
15
 
16
16
  def upload
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.16"
2
+ VERSION = "0.4.17"
3
3
  end
@@ -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 = {:organization => "foo"}
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 'foo' organization to add clouds")
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
@@ -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.16
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-26 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  type: :development