Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Conversation

@jamtaylo
Copy link
Contributor

When setting the hostname from $SET_HOSTNAME, replace any characters
not allowed in hostnames (as specified in RFC 952) with a hyphen.
This is enables a VM template to safely use the VM's name as the
hostname (by setting the context variable SET_HOSTNAME=$NAME).

When setting the hostname from $SET_HOSTNAME, replace any characters
not allowed in hostnames (as specified in RFC 952) with a hyphen.
This is enables a VM template to safely use the VM's name as the
hostname (by setting the context variable SET_HOSTNAME=$NAME).
Strip leading and trailing hyphens in the resulting munged hostname.
Leading and trailing hyphens are not valid according to RFCs 952 and 1123.
(This problem surfaces immediately when using the default configuration of
OneFlow, since it names new VMs ending with a parenthesis.)
jfontan added a commit that referenced this pull request Mar 10, 2016
@jfontan jfontan merged commit b2f3c9e into OpenNebula:master Mar 10, 2016
@jfontan
Copy link
Contributor

jfontan commented Mar 10, 2016

Great, thanks!

@jamtaylo jamtaylo deleted the replace-unsafe-chars-in-hostname branch March 10, 2016 14:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants