util: Remove validate_macaddr

Libvirt does this for us
This commit is contained in:
Cole Robinson 2019-06-06 18:02:20 -04:00
parent f47f6f3c7c
commit f4f8cfb33b
2 changed files with 0 additions and 16 deletions

View File

@ -8,7 +8,6 @@ import logging
import os
import random
from .. import util
from .device import Device
from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
@ -274,7 +273,6 @@ class DeviceInterface(Device):
if not self.macaddr:
return
util.validate_macaddr(self.macaddr)
self.is_conflict_net(self.conn, self.macaddr)
def set_default_source(self):

View File

@ -8,7 +8,6 @@
import logging
import os
import random
import re
import sys
import libvirt
@ -62,19 +61,6 @@ def validate_name(name_type, val):
(name_type, val, c))
def validate_macaddr(val):
if val is None:
return
if not isinstance(val, str):
raise ValueError(_("MAC address must be a string."))
form = re.match("^([0-9a-fA-F]{1,2}:){5}[0-9a-fA-F]{1,2}$", val)
if form is None:
raise ValueError(_("MAC address must be of the format "
"AA:BB:CC:DD:EE:FF, was '%s'") % val)
def generate_name(base, collision_cb, suffix="", lib_collision=True,
start_num=1, sep="-", force_num=False, collidelist=None):
"""