[et-mgmt-tools] [PATCH] domain name must not be numeric only

Saori Fukuta fukuta.saori at jp.fujitsu.com
Wed Feb 21 03:09:02 UTC 2007


Hi,

The attached patch adds to check the domain name that must not be
numeric only.

Signed-off-by: Saori Fukuta <fukuta.saori at jp.fujitsu.com>

Thanks,
Saori Fukuta.

Index: virtinst/Guest.py (python-virtinst-0.100.0)
===================================================================
--- Guest.py    2007-02-21 11:04:43.000000000 +0900
+++ Guest.py.num        2007-02-21 11:10:28.000000000 +0900
@@ -204,6 +204,8 @@ class Guest(object):
         return self._name
     def set_name(self, val):
         # FIXME: need some validation here
+        if re.match("^[0-9]*$", val):
+            raise ValueError, "Domain name must not be numeric only"
         if re.match("^[a-zA-Z0-9_]*$", val) == None:
             raise ValueError, "Domain name must be alphanumeric or _"
         if len(val) > 50:





More information about the et-mgmt-tools mailing list