Skip to content

Commit

Permalink
Merge pull request #240 from pearkes/fix_ssh_key_id_as_fixnum
Browse files Browse the repository at this point in the history
Fix ssh key id as fixnum
  • Loading branch information
petems committed Feb 16, 2016
2 parents a17b0ae + 94f3347 commit 6563e6a
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 1 deletion.
68 changes: 68 additions & 0 deletions features/cassettes/config/Single_SSH_key_as_number_in_config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions features/tugboat/config_number_key.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Feature: config
In order to easily load DigitalOcean config
As a user
I should be able to supply an ssh key as a number

@vcr
Scenario: Single SSH key as number in config
Given a '.tugboat' config with data:
"""
---
authentication:
access_token: faketokenazukxeh729ggxh9gjavvzw5cabdpq95txpzhz6ep6jvtquxztfkf2chyejcsg5
ssh:
ssh_user: root
ssh_key_path: "~/.ssh/id_rsa"
ssh_port: '22'
defaults:
region: nyc2
image: ubuntu-14-04-x64
size: 512mb
ssh_key: 27100
private_networking: 'false'
backups_enabled: 'false'
ip6: 'false'
"""
When I run `tugboat create number-based-key`
Then the exit status should not be 1
And the output should contain "Queueing creation of droplet 'number-based-key'...Droplet created!"
2 changes: 1 addition & 1 deletion lib/tugboat/middleware/create_droplet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def call(env)
if droplet_ssh_key_ids.kind_of?(Array)
droplet_key_array = droplet_ssh_key_ids
else
droplet_key_array = droplet_ssh_key_ids.split(',')
droplet_key_array = droplet_ssh_key_ids.to_s.split(',')
end

create_opts = {
Expand Down

0 comments on commit 6563e6a

Please sign in to comment.