foreman_host_extra_validator 0.0.1 → 0.0.2

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: 3449714af6d57a8ccb42e30ea7e26b79c9be264e
4
- data.tar.gz: 1c07057fa4f6aa5acc033bce411fec07cfb99cb0
3
+ metadata.gz: 1eabba0847ad99f589822d9f0dac68320256de7e
4
+ data.tar.gz: 97a3f9cf3dc3d2cf95a7e8f8a557f9b4f04778f7
5
5
  SHA512:
6
- metadata.gz: 360dc78ef9efee7edcb17150bd9102bf687cac6b9170cb2d8a7c124cde9d3550ff86c14cfc177b0ba4b05a5b5dab57995419407b2a3a6442e28aecea8b7a715f
7
- data.tar.gz: 8b728a7bd9cbb6e9b50a699eab7a4314dac1ed2cca8c604f758b1df3ecc37334d240983fab926e9bd09322472fe6a0944e283cd17ddf038e401bb9203544c11a
6
+ metadata.gz: c688c43110a0f05f4eb6839608ef36472a28c3e93c5e0a5c45197593a097a43b3054517925fec00d4a3450cd1107e68e34f04540a0b6b89dce96ca8c130171c3
7
+ data.tar.gz: b7ff2aff51281fb38b29d55540151637ffd8667a35af77ce12f0c4fd5572941a24f25a21ba68f4c943235f57581784da6f449d80d2801cbf34bff5126157d38b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ForemanPluginTemplate
1
+ # ForemanHostExtraValidator
2
2
 
3
3
  This plugin adds extra validations to a host.
4
4
  Currently this only supports adding a regex validator for a hostname.
@@ -7,8 +7,7 @@ module ForemanHostExtraValidator
7
7
 
8
8
  def validate_name_by_regex
9
9
  return unless validate_name_regex
10
- return if name =~ /#{validate_name_regex}/
11
- errors.add(:name, _('must match regex /%s/') % validate_name_regex)
10
+ errors.add(:name, _('must match regex /%s/') % validate_name_regex) unless shortname =~ /#{validate_name_regex}/
12
11
  end
13
12
 
14
13
  def validate_name_regex
@@ -1,3 +1,3 @@
1
1
  module ForemanHostExtraValidator
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_host_extra_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop