Read network interfaces from system and remove invalid characters from hostnames #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Systems with a bond the interface for example is called "ovs_bond0" which breaks the current behaviour of hardcoded interfaces. This PR changes the way adapters are handled by reading out all the interfaces from the system instead of keeping a hardcoded list.
Also this PR removes all invalid characters from the hostname as I had trouble with a host that had an underscore like "host_name". Underscores are not allowed to be in hostnames and bind won't load the zone if that hostname is used.
(See: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames )
Means: Replace every character sequence that is not a alphanumeric or a hyphen OR sequence of hyphens at the begining OR at the end of NAME with an empty string.