knife-digital_ocean 2.4.2 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/.travis.yml +2 -1
- data/CHANGELOG.md +10 -0
- data/README.md +37 -3
- data/knife-digital_ocean.gemspec +1 -2
- data/lib/chef/knife/digital_ocean_base.rb +3 -1
- data/lib/chef/knife/digital_ocean_domain_record_edit.rb +4 -1
- data/lib/chef/knife/digital_ocean_droplet_create.rb +4 -1
- data/lib/chef/knife/digital_ocean_droplet_destroy.rb +13 -7
- data/lib/chef/knife/digital_ocean_droplet_power.rb +7 -7
- data/lib/chef/knife/digital_ocean_droplet_powercycle.rb +4 -4
- data/lib/chef/knife/digital_ocean_droplet_reboot.rb +4 -4
- data/lib/chef/knife/digital_ocean_droplet_rebuild.rb +11 -8
- data/lib/chef/knife/digital_ocean_droplet_rename.rb +7 -7
- data/lib/chef/knife/digital_ocean_droplet_resize.rb +7 -7
- data/lib/chef/knife/digital_ocean_droplet_snapshot.rb +1 -1
- data/lib/chef/knife/digital_ocean_region_list.rb +1 -1
- data/lib/chef/knife/digital_ocean_size_list.rb +1 -1
- data/lib/chef/knife/digital_ocean_sshkey_create.rb +6 -3
- data/lib/knife-digital_ocean.rb +1 -0
- data/lib/knife-digital_ocean/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/domain_list.yml +1 -1
- data/spec/fixtures/vcr_cassettes/domain_record_list.yml +1 -1
- data/spec/fixtures/vcr_cassettes/region.yml +1 -1
- data/spec/fixtures/vcr_cassettes/sizes.yml +1 -1
- data/spec/fixtures/vcr_cassettes/sshkey.yml +1 -1
- data/spec/lib/chef/knife/digital_ocean_account_info_spec.rb +4 -3
- data/spec/lib/chef/knife/digital_ocean_domain_create_spec.rb +1 -2
- data/spec/lib/chef/knife/digital_ocean_domain_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_domain_record_create_spec.rb +1 -2
- data/spec/lib/chef/knife/digital_ocean_domain_record_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_create_spec.rb +0 -4
- data/spec/lib/chef/knife/digital_ocean_droplet_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_power_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_powercycle_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_reboot_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_rebuild_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_rename_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_resize_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_droplet_snapshot_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_image_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_region_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_size_list_spec.rb +0 -1
- data/spec/lib/chef/knife/digital_ocean_sshkey_create_spec.rb +1 -2
- data/spec/lib/chef/knife/digital_ocean_sshkey_list_spec.rb +0 -1
- data/spec/spec_helper.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40163c61e89b1e5d4eaa012a5923eab7a6ddc928
|
4
|
+
data.tar.gz: efe07cc6b432eae199dc2e2e3bd421ba290deb71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e607c8f249fb7eb2991cccfc4fcdbe70376367dbb3f300ca2375b635f5ac5dae7331cb9ded4c1a4f6655fa1569c2663a546561ace85f64d725dc21000511a7a
|
7
|
+
data.tar.gz: c3af42a24737b8ab49c73557e24c15959ce4be5a1eb7571b4b59f412a1ff2f67de32f4c041c4334ffccae04b879649e33e33fd23113639a2d58776afe872937f
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# 2.5.0 / unreleased
|
2
|
+
|
3
|
+
* fix vcr cassettes (droplet_kit pagination)
|
4
|
+
* drop support for Ruby 2.0.0
|
5
|
+
* fix to work with chef 12.5.x
|
6
|
+
* update droplet_kit dependency to 1.3.x
|
7
|
+
* fixed some rubocop issues (some are still pending)
|
8
|
+
* we will drop support for chef 10 and chef 11 soon,
|
9
|
+
please upgrade to chef 12 ASAP!
|
10
|
+
|
1
11
|
# 2.4.2 / 2015-07-04
|
2
12
|
|
3
13
|
* Fix knife digital_ocean droplet destroy
|
data/README.md
CHANGED
@@ -12,12 +12,24 @@ You can also use [knife-solo](http://matschaffer.github.com/knife-solo/) or [kni
|
|
12
12
|
|
13
13
|
This knife plugin uses the [droplet_kit](https://github.com/digitalocean/droplet_kit) rubygem.
|
14
14
|
|
15
|
+
Knife::DigitalOcean supports Chef 12, legacy support for older Chefs
|
16
|
+
will be removed with 3.x.x by the end of 2015.
|
17
|
+
|
15
18
|
## Installation
|
16
19
|
|
20
|
+
### when using ChefDK
|
21
|
+
|
22
|
+
```shell
|
23
|
+
➜ chef gem install knife-digital_ocean
|
24
|
+
```
|
25
|
+
|
26
|
+
### in typical Ruby setup
|
27
|
+
|
17
28
|
```shell
|
18
29
|
➜ gem install knife-digital_ocean
|
19
30
|
```
|
20
31
|
|
32
|
+
|
21
33
|
## Overview
|
22
34
|
|
23
35
|
This plugin provides the following sub-commands:
|
@@ -467,7 +479,7 @@ example.com 1800
|
|
467
479
|
#### Create a domain record
|
468
480
|
|
469
481
|
```shell
|
470
|
-
➜ knife digital_ocean domain record create -D example.com -T
|
482
|
+
➜ knife digital_ocean domain record create -D example.com -T CNAME -N www -a @
|
471
483
|
```
|
472
484
|
|
473
485
|
#### Destroy a domain record
|
@@ -504,6 +516,28 @@ UUID Email Droplet Limit Email V
|
|
504
516
|
4. Push to the branch (`git push origin my-new-feature`)
|
505
517
|
5. Create new Pull Request
|
506
518
|
|
519
|
+
|
520
|
+
### Tests
|
521
|
+
|
522
|
+
To run tests, please declare the `DIGITALOCEAN_ACCESS_TOKEN`
|
523
|
+
environment variable, e.g.:
|
524
|
+
|
525
|
+
```shell
|
526
|
+
export DIGITALOCEAN_ACCESS_TOKEN="fake_access_token"
|
527
|
+
rspec
|
528
|
+
```
|
529
|
+
|
530
|
+
|
531
|
+
### RuboCop / Ruby Style Guide
|
532
|
+
|
533
|
+
We want to make sure that our code complies with the Ruby Style Guide:
|
534
|
+
|
535
|
+
see:
|
536
|
+
|
537
|
+
- https://github.com/bbatsov/ruby-style-guide
|
538
|
+
- https://github.com/bbatsov/rubocop
|
539
|
+
|
540
|
+
|
507
541
|
### Contributors
|
508
542
|
|
509
543
|
* [Teemu Matilainen](https://github.com/tmatilai)
|
@@ -517,6 +551,6 @@ Apache 2.0 (like Chef itself), see LICENSE.txt file.
|
|
517
551
|
|
518
552
|
## Copyright
|
519
553
|
|
520
|
-
Copyright ©
|
521
|
-
Copyright ©
|
554
|
+
Copyright © 2015 [Roland Moriz](https://roland.io), [Moriz GmbH](https://moriz.de/)
|
555
|
+
Copyright © 2015 [Greg Fitzgerald](https://github.com/gregf)
|
522
556
|
|
data/knife-digital_ocean.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.license = 'Apache 2.0'
|
15
15
|
|
16
16
|
gem.add_dependency 'chef', '>= 10.18'
|
17
|
-
gem.add_dependency 'droplet_kit', '~> 1.
|
17
|
+
gem.add_dependency 'droplet_kit', '~> 1.3.0'
|
18
18
|
|
19
19
|
gem.add_development_dependency 'rspec', '~> 3.1'
|
20
20
|
gem.add_development_dependency 'rubocop', '~> 0.27'
|
@@ -30,7 +30,6 @@ Gem::Specification.new do |gem|
|
|
30
30
|
gem.add_development_dependency 'simplecov'
|
31
31
|
gem.add_development_dependency 'simplecov-console'
|
32
32
|
|
33
|
-
|
34
33
|
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
35
34
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
36
35
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
@@ -18,6 +18,7 @@ class Chef
|
|
18
18
|
def self.load_deps
|
19
19
|
require 'droplet_kit'
|
20
20
|
require 'json'
|
21
|
+
require 'chef/mixin/shell_out'
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.included(includer)
|
@@ -55,7 +56,8 @@ class Chef
|
|
55
56
|
|
56
57
|
keys.each do |k|
|
57
58
|
if locate_config_value(k).nil?
|
58
|
-
errors << "You did not provide a valid '#{k}' value.
|
59
|
+
errors << "You did not provide a valid '#{k}' value. " \
|
60
|
+
"Please set knife[:#{k}] in your knife.rb or pass as an option."
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
@@ -80,7 +80,10 @@ class Chef
|
|
80
80
|
name: locate_config_value(:name),
|
81
81
|
data: locate_config_value(:data)
|
82
82
|
)
|
83
|
-
result = client.domain_records.update
|
83
|
+
result = client.domain_records.update(domain_record,
|
84
|
+
for_domain: locate_config_value(:domain),
|
85
|
+
id: locate_config_value(:record)
|
86
|
+
)
|
84
87
|
ui.info 'OK' if result == true || ui.error(JSON.parse(result)['message'])
|
85
88
|
end
|
86
89
|
end
|
@@ -25,7 +25,10 @@ class Chef
|
|
25
25
|
# Knife loads subcommands automatically, so we can just check if the
|
26
26
|
# class exists.
|
27
27
|
Chef::Knife::SoloBootstrap.load_deps if defined? Chef::Knife::SoloBootstrap
|
28
|
-
|
28
|
+
if defined? Chef::Knife::ZeroBootstrap
|
29
|
+
Chef::Knife::ZeroBootstrap.load_deps
|
30
|
+
self.options = Chef::Knife::ZeroBootstrap.options.merge(options)
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
banner 'knife digital_ocean droplet create (options)'
|
@@ -20,14 +20,14 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet destroy (options)'
|
21
21
|
|
22
22
|
option :server,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-S ID',
|
24
|
+
long: '--server ID',
|
25
|
+
description: 'The server id'
|
26
26
|
|
27
27
|
option :all,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
short: '-a',
|
29
|
+
long: '--all',
|
30
|
+
description: '!WARNING! UNRECOVERABLE Destroy all droplets.'
|
31
31
|
|
32
32
|
def run
|
33
33
|
$stdout.sync = true
|
@@ -40,7 +40,13 @@ class Chef
|
|
40
40
|
droplets_ids = [locate_config_value(:server)]
|
41
41
|
elsif locate_config_value(:all)
|
42
42
|
ui.error('Warning all servers will be lost unless you exit with ctrl-c now!')
|
43
|
-
|
43
|
+
|
44
|
+
15.times do |x|
|
45
|
+
print x
|
46
|
+
print 13.chr
|
47
|
+
sleep 1
|
48
|
+
end
|
49
|
+
|
44
50
|
droplets_ids = client.droplets.all.map(&:id)
|
45
51
|
else
|
46
52
|
ui.error 'You need to specify either a --server id or --all'
|
@@ -20,14 +20,14 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet power (options)'
|
21
21
|
|
22
22
|
option :action,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-a ACTION',
|
24
|
+
long: '--action ACTION',
|
25
|
+
description: 'Power Action On/Off'
|
26
26
|
|
27
27
|
option :id,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
short: '-I ID',
|
29
|
+
long: '--droplet-id ID',
|
30
|
+
description: 'Droplet ID'
|
31
31
|
|
32
32
|
def run
|
33
33
|
$stdout.sync = true
|
@@ -61,6 +61,6 @@ class Chef
|
|
61
61
|
|
62
62
|
wait_for_status(result)
|
63
63
|
end
|
64
|
-
|
64
|
+
end
|
65
65
|
end
|
66
66
|
end
|
@@ -20,9 +20,9 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet powercycle (options)'
|
21
21
|
|
22
22
|
option :id,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-I ID',
|
24
|
+
long: '--droplet-id ID',
|
25
|
+
description: 'Droplet ID'
|
26
26
|
|
27
27
|
def run
|
28
28
|
$stdout.sync = true
|
@@ -43,6 +43,6 @@ class Chef
|
|
43
43
|
|
44
44
|
wait_for_status(result, status: 'active')
|
45
45
|
end
|
46
|
-
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
@@ -20,9 +20,9 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet reboot (options)'
|
21
21
|
|
22
22
|
option :id,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-I ID',
|
24
|
+
long: '--droplet-id ID',
|
25
|
+
description: 'Droplet ID'
|
26
26
|
|
27
27
|
def run
|
28
28
|
$stdout.sync = true
|
@@ -43,6 +43,6 @@ class Chef
|
|
43
43
|
|
44
44
|
wait_for_status(result)
|
45
45
|
end
|
46
|
-
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
@@ -20,14 +20,14 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet rebuild (options)'
|
21
21
|
|
22
22
|
option :image,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-i IMAGE',
|
24
|
+
long: '--image-id IMAGE',
|
25
|
+
description: 'Image ID'
|
26
26
|
|
27
27
|
option :id,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
short: '-I ID',
|
29
|
+
long: '--droplet-id ID',
|
30
|
+
description: 'Droplet ID'
|
31
31
|
|
32
32
|
def run
|
33
33
|
$stdout.sync = true
|
@@ -44,7 +44,10 @@ class Chef
|
|
44
44
|
exit 1
|
45
45
|
end
|
46
46
|
|
47
|
-
result = client.droplet_actions.rebuild(
|
47
|
+
result = client.droplet_actions.rebuild(
|
48
|
+
droplet_id: locate_config_value(:id),
|
49
|
+
image: locate_config_value(:image)
|
50
|
+
)
|
48
51
|
|
49
52
|
unless result.class == DropletKit::Action
|
50
53
|
ui.error JSON.parse(result)['message']
|
@@ -53,6 +56,6 @@ class Chef
|
|
53
56
|
|
54
57
|
wait_for_status(result, status: 'active')
|
55
58
|
end
|
56
|
-
|
59
|
+
end
|
57
60
|
end
|
58
61
|
end
|
@@ -20,14 +20,14 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet rename (options)'
|
21
21
|
|
22
22
|
option :name,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-N NAME',
|
24
|
+
long: '--droplet-name NAME',
|
25
|
+
description: 'Name of droplet'
|
26
26
|
|
27
27
|
option :id,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
short: '-I ID',
|
29
|
+
long: '--droplet-id ID',
|
30
|
+
description: 'Droplet ID'
|
31
31
|
|
32
32
|
def run
|
33
33
|
$stdout.sync = true
|
@@ -53,6 +53,6 @@ class Chef
|
|
53
53
|
|
54
54
|
wait_for_status(result)
|
55
55
|
end
|
56
|
-
|
56
|
+
end
|
57
57
|
end
|
58
58
|
end
|
@@ -20,14 +20,14 @@ class Chef
|
|
20
20
|
banner 'knife digital_ocean droplet resize (options)'
|
21
21
|
|
22
22
|
option :size,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
short: '-s SIZE',
|
24
|
+
long: '--size SIZE',
|
25
|
+
description: 'Power Action On/Off'
|
26
26
|
|
27
27
|
option :id,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
short: '-I ID',
|
29
|
+
long: '--droplet-id ID',
|
30
|
+
description: 'Droplet ID'
|
31
31
|
|
32
32
|
def run
|
33
33
|
$stdout.sync = true
|
@@ -53,6 +53,6 @@ class Chef
|
|
53
53
|
|
54
54
|
wait_for_status(result)
|
55
55
|
end
|
56
|
-
|
56
|
+
end
|
57
57
|
end
|
58
58
|
end
|
@@ -36,16 +36,19 @@ class Chef
|
|
36
36
|
validate!
|
37
37
|
|
38
38
|
unless locate_config_value(:name)
|
39
|
-
ui.error('SSH Key name cannot be empty. => -
|
39
|
+
ui.error('SSH Key name cannot be empty. => -n <sshkey-name>')
|
40
40
|
exit 1
|
41
41
|
end
|
42
42
|
|
43
43
|
unless locate_config_value(:public_key)
|
44
|
-
ui.error('SSH key file needs to be specified. => -
|
44
|
+
ui.error('SSH key file needs to be specified. => -i <public_key>')
|
45
45
|
exit 1
|
46
46
|
end
|
47
47
|
|
48
|
-
ssh_key = DropletKit::SSHKey.new
|
48
|
+
ssh_key = DropletKit::SSHKey.new(
|
49
|
+
name: locate_config_value(:name),
|
50
|
+
public_key: File.read(File.expand_path(locate_config_value(:public_key)))
|
51
|
+
)
|
49
52
|
result = client.ssh_keys.create(ssh_key)
|
50
53
|
ui.info 'OK' if result.class == DropletKit::SSHKey || ui.error(JSON.parse(result)['message'])
|
51
54
|
end
|
data/lib/knife-digital_ocean.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanAccountInfo do
|
4
|
-
|
5
4
|
subject { Chef::Knife::DigitalOceanAccountInfo.new }
|
6
5
|
|
7
6
|
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
@@ -22,14 +21,16 @@ describe Chef::Knife::DigitalOceanAccountInfo do
|
|
22
21
|
|
23
22
|
it 'should output the column headers' do
|
24
23
|
VCR.use_cassette('accountinfo') do
|
25
|
-
expect(subject).to receive(:puts)
|
24
|
+
expect(subject).to receive(:puts)
|
25
|
+
.with(/^UUID\s+Email\s+Droplet Limit\s+Email Verified\n/)
|
26
26
|
subject.run
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'should output a list of the available Digital Ocean account info' do
|
31
31
|
VCR.use_cassette('accountinfo') do
|
32
|
-
expect(subject).to receive(:puts)
|
32
|
+
expect(subject).to receive(:puts)
|
33
|
+
.with(/\b49e2e737d3a7407a042bb7e88f4da8629166f2b9\s+greg@gregf.org\s+20\s+true\s+\n/)
|
33
34
|
subject.run
|
34
35
|
end
|
35
36
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanDomainCreate do
|
4
|
-
|
5
4
|
subject { Chef::Knife::DigitalOceanDomainCreate.new }
|
6
5
|
|
7
6
|
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
@@ -29,7 +28,7 @@ describe Chef::Knife::DigitalOceanDomainCreate do
|
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
32
|
-
# TODO Figure out why this is now failing
|
31
|
+
# TODO: Figure out why this is now failing
|
33
32
|
# it 'should return OK' do
|
34
33
|
# VCR.use_cassette('domain_create') do
|
35
34
|
# expect($stdout).to receive(:puts).with('OK')
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanDomainRecordCreate do
|
4
|
-
|
5
4
|
subject { Chef::Knife::DigitalOceanDomainRecordCreate.new }
|
6
5
|
|
7
6
|
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
@@ -31,7 +30,7 @@ describe Chef::Knife::DigitalOceanDomainRecordCreate do
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
# TODO Figure out why this is now failing
|
33
|
+
# TODO: Figure out why this is now failing
|
35
34
|
# it 'should return OK' do
|
36
35
|
# VCR.use_cassette('domain_record_create') do
|
37
36
|
# expect($stdout).to receive(:puts).with('OK')
|
@@ -5,7 +5,6 @@ def mock_api_response(data = {})
|
|
5
5
|
end
|
6
6
|
|
7
7
|
describe Chef::Knife::DigitalOceanDropletCreate do
|
8
|
-
|
9
8
|
subject do
|
10
9
|
s = Chef::Knife::DigitalOceanDropletCreate.new
|
11
10
|
allow(s).to receive(:client).and_return double(DropletKit::Droplet)
|
@@ -82,7 +81,6 @@ describe Chef::Knife::DigitalOceanDropletCreate do
|
|
82
81
|
end
|
83
82
|
|
84
83
|
context 'bootstrapping for knife-solo' do
|
85
|
-
|
86
84
|
let(:custom_config) do
|
87
85
|
{
|
88
86
|
solo: true
|
@@ -126,7 +124,6 @@ describe Chef::Knife::DigitalOceanDropletCreate do
|
|
126
124
|
expect { subject.run }.to raise_error(SystemExit)
|
127
125
|
end
|
128
126
|
end
|
129
|
-
|
130
127
|
end
|
131
128
|
|
132
129
|
context 'no bootstrapping' do
|
@@ -199,5 +196,4 @@ describe Chef::Knife::DigitalOceanDropletCreate do
|
|
199
196
|
expect(bootstrap.config[:ssh_port]).to eql(ssh_port)
|
200
197
|
end
|
201
198
|
end
|
202
|
-
|
203
199
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanSshkeyCreate do
|
4
|
-
|
5
4
|
subject { Chef::Knife::DigitalOceanSshkeyCreate.new }
|
6
5
|
|
7
6
|
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
@@ -29,7 +28,7 @@ describe Chef::Knife::DigitalOceanSshkeyCreate do
|
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
32
|
-
# TODO Figure out why this is now failing
|
31
|
+
# TODO: Figure out why this is now failing
|
33
32
|
# it 'should return OK' do
|
34
33
|
# VCR.use_cassette('sshkey_create') do
|
35
34
|
# expect($stdout).to receive(:puts).with('OK')
|
data/spec/spec_helper.rb
CHANGED
@@ -61,7 +61,7 @@ SimpleCov.start
|
|
61
61
|
|
62
62
|
# Cleverly borrowed from knife-rackspace, thank you!
|
63
63
|
def filter_headers(interaction, pattern, placeholder)
|
64
|
-
[interaction.request.headers, interaction.response.headers].each do |
|
64
|
+
[interaction.request.headers, interaction.response.headers].each do |headers|
|
65
65
|
sensitive_tokens = headers.select { |key| key.to_s.match(pattern) }
|
66
66
|
sensitive_tokens.each do |key, _value|
|
67
67
|
headers[key] = placeholder
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-digital_ocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roland Moriz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.
|
34
|
+
version: 1.3.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.
|
41
|
+
version: 1.3.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- ".coveralls.yml"
|
233
233
|
- ".gitignore"
|
234
234
|
- ".rspec"
|
235
|
+
- ".rubocop.yml"
|
235
236
|
- ".travis.yml"
|
236
237
|
- CHANGELOG.md
|
237
238
|
- Gemfile
|
@@ -334,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
334
335
|
version: '0'
|
335
336
|
requirements: []
|
336
337
|
rubyforge_project:
|
337
|
-
rubygems_version: 2.
|
338
|
+
rubygems_version: 2.5.1
|
338
339
|
signing_key:
|
339
340
|
specification_version: 4
|
340
341
|
summary: A plugin for chef's knife to manage instances of DigitalOcean servers
|