summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Carrez <thierry@openstack.org>2011-08-24 18:01:29 +0200
committerThierry Carrez <thierry@openstack.org>2011-08-24 18:01:29 +0200
commit326268b9bf5d958263b70c64ca2ed21deac1a14e (patch)
treebd08c125eb77b298d4db79e5756300d09f9b6136
parent8191cd38b2030a9d8816bcc21bd0cbc0119a7d91 (diff)
Let's be more elegant
-rw-r--r--nova/compute/api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 88ba81018..be1dbdd51 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -62,7 +62,7 @@ def generate_default_hostname(instance):
c = chr(i)
if ('a' <= c <= 'z') or ('0' <= c <= '9') or (c == '-'):
table += c
- elif (c == ' ') or (c == '_'):
+ elif c in " _":
table += '-'
elif ('A' <= c <= 'Z'):
table += c.lower()