pingable_ipam_plugin 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 5167c6a2b4558580a184c8f21d89054329acb2d87ab6b803b50f2838cd6d0c3f
4
- data.tar.gz: 23f4fb9c0b37e4e5e2879092a5b00197b05655c4afb1e2574288a86e1edaaaec
3
+ metadata.gz: 98f252592af66182ea5caa67ee7e6277b0d6c9a93a746b28c2f949cc13019176
4
+ data.tar.gz: f5e007d453bd182a85d3e20bf0441c5276ae9365d9267fe9c8541d2fa187d731
5
5
  SHA512:
6
- metadata.gz: 35052c2ee42d1f1e6d729eb6c13a03b014852aa75e457794c349ec122493ff85e6f1443f2be593185a4c1547e7d4161052b5a0109528e86a76c18485afa04c84
7
- data.tar.gz: 27fb31ea168284836131069b6385a481d1709d21792f5e52cf674561d25cc9cd7f661418c087ddd725574ef34961619785d8b0991f032deaa6cbd79a8c3ef869
6
+ metadata.gz: 001c810cfc73df2a3a3cf0d767b63c5e13f1b53d29d536d13248ee045ec26cf804474c7e71f903f70814d9143ddd431182d5b362b7a1317744ed336984f09542
7
+ data.tar.gz: 648e49b2f2884c8bdce12f7bb79b6df125f2d8c32d7cc4bb8c4ea272b063f712c9e881593b51974a35d8bcd178f9742447c3752908a3dd9602c35872156ca26e
data/README.md CHANGED
@@ -3,6 +3,9 @@
3
3
  This IPAM mode extends the defaul Random DB adding one extra step
4
4
  before suggesting IP: ping that address and if it is pingable it will not be suggested.
5
5
 
6
+ To prevent human error when the host is created without assigned subnet the plugin adds
7
+ a new validation rule: the subnet must be selected.
8
+
6
9
  ## Installation
7
10
 
8
11
  See [How_to_Install_a_Plugin](http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Plugin)
@@ -0,0 +1,9 @@
1
+ module PingableIpamPlugin
2
+ module NicExtensions
3
+ extend ActiveSupport::Concern
4
+ included do
5
+ validates :subnet_id, :presence => true, :if => Proc.new { |nic| nic.host_managed? && nic.primary? }
6
+ end
7
+ end
8
+ end
9
+
@@ -16,6 +16,7 @@ module PingableIpamPlugin
16
16
  begin
17
17
  ::IPAM.send(:include, PingableIpamPlugin::IpamExtensions)
18
18
  ::Subnet::Ipv4.singleton_class.send(:prepend, PingableIpamPlugin::Ipv4Extensions)
19
+ ::Nic::Base.send(:include, PingableIpamPlugin::NicExtensions)
19
20
  rescue => e
20
21
  Rails.logger.warn "PingableIpamPlugin: skipping engine hook (#{e})"
21
22
  end
@@ -1,3 +1,3 @@
1
1
  module PingableIpamPlugin
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pingable_ipam_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Parshin
@@ -51,6 +51,7 @@ files:
51
51
  - Rakefile
52
52
  - app/models/concerns/pingable_ipam_plugin/ipam_extensions.rb
53
53
  - app/models/concerns/pingable_ipam_plugin/ipv4_extensions.rb
54
+ - app/models/concerns/pingable_ipam_plugin/nic_extensions.rb
54
55
  - app/services/ipam/ping_random_db.rb
55
56
  - lib/pingable_ipam_plugin.rb
56
57
  - lib/pingable_ipam_plugin/engine.rb