Puppet: System Administration Automated

Support

Ticket #1132 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

host validation doesn't like hyphens after first dot

Reported by: freiheit Assigned to: community
Priority: normal Milestone: 0.24.3
Component: library Version: 0.24.2
Severity: normal Keywords: host validation
Cc: eric.eisenhart@sonoma.edu Triage Stage: Ready for checkin
Attached Patches: Code Complexity: Unknown

Description

host didn't want to work with a few of our odder hostnames (giving errors on the client), and I tracked the problem down to the validate routine in puppet/type/host.rb.

Basically, "foo-bar" works, "foo-bar.baz" works, but "foo.bar-baz" doesn't. And all three should.

Attaching patch that fixes the problem and adds tests for a number of different formats of valid hostname.

Alternately, using something more like the original pseudo-code in #151 might be even better.

Attachments

host-validate.patch (1.4 kB) - added by freiheit on 03/12/08 21:53:45.
patch that allows hyphens in more of the places they should be allowed
host-validate-alternate.patch (1.9 kB) - added by freiheit on 03/13/08 00:24:31.
Alternate version of the validate code that keeps the regex simple and debuggable. Also a few more tests.

Change History

03/12/08 21:53:45 changed by freiheit

  • attachment host-validate.patch added.

patch that allows hyphens in more of the places they should be allowed

03/13/08 00:24:31 changed by freiheit

  • attachment host-validate-alternate.patch added.

Alternate version of the validate code that keeps the regex simple and debuggable. Also a few more tests.

03/13/08 15:16:51 changed by luke

  • stage changed from Unreviewed to Ready for checkin.
  • milestone set to 0.24.3.

03/13/08 19:52:43 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Applied in [056d213].

03/13/08 19:56:07 changed by luke

Very strange; that commit seems to be lost. Redon in [4956323].