From 184b96a815a3e81119817b56e5e2a08a9f21824c Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 14 Sep 2018 15:19:03 -0400 Subject: [PATCH] virtinst: util: Remove unused validate_uuid We let libvirt error nowadays --- virtinst/util.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/virtinst/util.py b/virtinst/util.py index b5629e1b..7ed960bf 100644 --- a/virtinst/util.py +++ b/virtinst/util.py @@ -60,26 +60,6 @@ def libvirt_collision(collision_cb, val): return check -def validate_uuid(val): - if not isinstance(val, str): - raise ValueError(_("UUID must be a string.")) - - 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) - 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: # UUID had no dashes, so add them in - val = (val[0:8] + "-" + val[8:12] + "-" + val[12:16] + - "-" + val[16:20] + "-" + val[20:32]) - return val - - def validate_name(name_type, val): # Rather than try and match libvirt's regex, just forbid things we # know don't work