foreman_digitalocean 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09968431a3ccdbbd31a0dde996cfff6358a2a254
4
- data.tar.gz: d044e4f386bd33594bcab16953e3380f2e334de7
3
+ metadata.gz: 40e7592a3281e8c3a309dea6de05fe97d6e38625
4
+ data.tar.gz: 84c63f6d23de034071ee0fb632cbbed358eb18cb
5
5
  SHA512:
6
- metadata.gz: 83c7f182dfabf192159f2c2678f9aafceaece54ba60f9d9a19d397456d54c6c969a588242b25df274b5e349e3dd21bd77dff86324c867a9df36e06715ca94a7d
7
- data.tar.gz: 9a861c05403d615412a39530860cca00cc2193bd921aaee5ea9d63dd2b34fd2315e5208ab46d78685720a30b8803b3289a0258bb658dc38cd0af7d12bf336f8a
6
+ metadata.gz: 441f829ee9a1642edfc3144000aa71ae7046ac903915a266dd6d075ee7ec1cbaeb0cd5bb76ea3b1b7700b0e45862fc88927ef3280b87eb6d7ca50091b7f9025f
7
+ data.tar.gz: 6e35c6b39759de2a4ac1bdfb3ebcfb346a55f767e3a4cfdb0e2b5a333bdf9ccbc0ea56e15c911993df395baa112cc1fc91f43970337663adf391cda8dfc6d3a3
data/README.md CHANGED
@@ -52,12 +52,14 @@ To verify that the installation was successful, go to Foreman, top bar **Adminis
52
52
  | --------------- | --------------:|
53
53
  | <= 1.7.x | ~> 0.1.x |
54
54
  | >= 1.8.0 | ~> 0.2.x |
55
+ | >= 1.11.0 | ~> 1.x |
56
+ | >= 1.13.0 | ~> 1.1 |
55
57
 
56
58
  ## Configuration
57
59
 
58
60
  Go to **Infrastructure > Compute Resources** and click on "New Compute Resource".
59
61
 
60
- Choose the **DigitalOcean provider**, and fill in all the fields. The API client and secret keys can be retrieved from [the API v1 DigitalOcean site](https://cloud.digitalocean.com/api_access). The secret key will be encrypted in the database.
62
+ Choose the **DigitalOcean provider**, and fill in all the fields. You need an API token with read and write access, which can be created at the [DigitalOcean API section](https://cloud.digitalocean.com/settings/api/tokens). It will be encrypted in the database.
61
63
 
62
64
  That's it. You're now ready to create and manage droplets in your new DigitalOcean compute resource.
63
65
 
@@ -12,8 +12,6 @@ module ForemanDigitalocean
12
12
  after_create :setup_key_pair
13
13
  after_destroy :destroy_key_pair
14
14
 
15
- attr_accessible :region, :api_key
16
-
17
15
  def to_label
18
16
  "#{name} (#{provider_friendly_name})"
19
17
  end
@@ -79,8 +77,7 @@ module ForemanDigitalocean
79
77
  end
80
78
 
81
79
  def associated_host(vm)
82
- Host.authorized(:view_hosts, Host).
83
- where(:ip => [vm.public_ip_address, vm.private_ip_address]).first
80
+ associate_by("ip", [vm.public_ip_address])
84
81
  end
85
82
 
86
83
  def user_data_supported?
@@ -1,14 +1,12 @@
1
- <%= password_f f, :api_key, :label => _("API Key"), :unset => unset_password? %>
1
+ <%= password_f f, :password, :label => _("API Key"), :unset => unset_password? %>
2
2
  <% regions = f.object.regions rescue [] %>
3
3
 
4
4
  <div id='region_selection'>
5
- <%= select_f(
6
- f, :region, regions, :slug, :name, {},
5
+ <%= selectable_f(f, :region, regions.map(&:slug), {},
7
6
  :label => _('Default Region'), :disabled => regions.empty?,
8
7
  :help_inline => link_to_function(
9
8
  regions.empty? ? _("Load Regions") : _("Test Connection"), "testConnection(this)",
10
9
  :class => "btn + #{regions.empty? ? "btn-default" : "btn-success"}",
11
10
  :'data-url' => test_connection_compute_resources_path) +
12
- spinner('', :id => 'test_connection_indicator',
13
- :class => 'hide').html_safe) %>
11
+ hidden_spinner('', :id => 'test_connection_indicator').html_safe) %>
14
12
  </div>
@@ -18,6 +18,7 @@ module ForemanDigitalocean
18
18
  Foreman::Plugin.register :foreman_digitalocean do
19
19
  requires_foreman '>= 1.8'
20
20
  compute_resource ForemanDigitalocean::Digitalocean
21
+ parameter_filter ComputeResource, :region, :api_key
21
22
  end
22
23
  end
23
24
 
@@ -8,6 +8,7 @@ namespace :test do
8
8
  "#{ForemanDigitalocean::Engine.root}/test/**/*_test.rb"
9
9
  ]
10
10
  t.verbose = true
11
+ t.warning = false
11
12
  end
12
13
 
13
14
  Rake::Task[test_task.name].invoke
@@ -1,3 +1,3 @@
1
1
  module ForemanDigitalocean
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -1,18 +1,17 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
- class ForemanDigitalocean::DigitaloceanTest < ActiveSupport::TestCase
4
- should validate_presence_of(:api_key)
5
- should allow_mass_assignment_of(:region)
6
- should allow_mass_assignment_of(:api_key)
7
- should delegate_method(:flavors).to(:client)
8
- should have_one(:key_pair)
3
+ module ForemanDigitalocean
4
+ class DigitaloceanTest < ActiveSupport::TestCase
5
+ should validate_presence_of(:api_key)
6
+ should have_one(:key_pair)
9
7
 
10
- setup { Fog.mock! }
11
- teardown { Fog.unmock! }
8
+ setup { Fog.mock! }
9
+ teardown { Fog.unmock! }
12
10
 
13
- test 'ssh key pair gets created after its saved' do
14
- digitalocean = FactoryGirl.build(:digitalocean_cr)
15
- digitalocean.expects(:setup_key_pair)
16
- digitalocean.save
11
+ test 'ssh key pair gets created after its saved' do
12
+ digitalocean = FactoryGirl.build(:digitalocean_cr)
13
+ digitalocean.expects(:setup_key_pair)
14
+ digitalocean.save
15
+ end
17
16
  end
18
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy McNeely, Daniel Lobato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.26'
19
+ version: '0.42'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.26'
26
+ version: '0.42'
27
27
  description: Provision and manage DigitalOcean droplets from Foreman.
28
28
  email:
29
29
  - elobatocs@gmail.com
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.2.2
77
+ rubygems_version: 2.5.0
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Provision and manage DigitalOcean droplets from Foreman