[et-mgmt-tools] Re:[PATCH][RESEND] check a UUID format
S.Sakamoto
fj0588di at aa.jp.fujitsu.com
Thu Apr 12 10:55:05 UTC 2007
> S.Sakamoto wrote:
> > Hi
> >
> > Would you give me a comment on this patch?
> > If not, please apply it.
> >
> >> Signs of regular expression to use
> >> for the number of the characters restrictions are different.
> >
> Opps, sorry, already applied -- I simply forgot to send mail about it.
> Thanks!
>
Hi, Hugh
I made a mistake.
--revision point
& -> $
Please apply this patch.
Thanks,
Shigeki Sakamoto.
==========================================================
diff -r 04ddef989ad7 virtinst/Guest.py
--- a/virtinst/Guest.py Wed Apr 04 09:30:55 2007 -0400
+++ b/virtinst/Guest.py Thu Apr 05 11:43:37 2007 +0900
@@ -417,9 +417,9 @@ class Guest(object):
return self._uuid
def set_uuid(self, val):
# need better validation
- form = re.match("[a-fA-F0-9]{8}[-]([a-fA-F0-9]{4}[-]){3}[a-fA-F0-9]{12}&", val)
+ form = re.match("[a-fA-F0-9]{8}[-]([a-fA-F0-9]{4}[-]){3}[a-fA-F0-9]{12}$", val)
if form is None:
- form=re.match("[a-fA-F0-9]{32}&", val)
+ form=re.match("[a-fA-F0-9]{32}$", val)
if form is None:
raise ValueError, "UUID must be a 32-digit hexadecimal number. It may take the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX or may omit hyphens altogether."
else:
More information about the et-mgmt-tools
mailing list