mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
util: Remove validate_macaddr
Libvirt does this for us
This commit is contained in:
parent
f47f6f3c7c
commit
f4f8cfb33b
@ -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):
|
||||
|
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user