From 326268b9bf5d958263b70c64ca2ed21deac1a14e Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Wed, 24 Aug 2011 18:01:29 +0200 Subject: Let's be more elegant --- nova/compute/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- cgit