summaryrefslogtreecommitdiff
path: root/python/vyos/validate.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r--python/vyos/validate.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index e5d8c6043..7afbe81c9 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -100,8 +100,8 @@ def is_intf_addr_assigned(intf, address) -> bool:
def is_addr_assigned(ip_address, vrf=None) -> bool:
""" Verify if the given IPv4/IPv6 address is assigned to any interface """
from netifaces import interfaces
- from vyos.util import get_interface_config
- from vyos.util import dict_search
+ from vyos.utils.network import get_interface_config
+ from vyos.utils.dict import dict_search
for interface in interfaces():
# Check if interface belongs to the requested VRF, if this is not the
# case there is no need to proceed with this data set - continue loop
@@ -218,7 +218,7 @@ def assert_mtu(mtu, ifname):
assert_number(mtu)
import json
- from vyos.util import cmd
+ from vyos.utils.process import cmd
out = cmd(f'ip -j -d link show dev {ifname}')
# [{"ifindex":2,"ifname":"eth0","flags":["BROADCAST","MULTICAST","UP","LOWER_UP"],"mtu":1500,"qdisc":"pfifo_fast","operstate":"UP","linkmode":"DEFAULT","group":"default","txqlen":1000,"link_type":"ether","address":"08:00:27:d9:5b:04","broadcast":"ff:ff:ff:ff:ff:ff","promiscuity":0,"min_mtu":46,"max_mtu":16110,"inet6_addr_gen_mode":"none","num_tx_queues":1,"num_rx_queues":1,"gso_max_size":65536,"gso_max_segs":65535}]
parsed = json.loads(out)[0]