import logging
import re
import subprocess
-import platform
import requests
from collections import Counter
-ubuntu_pkgs = {'release': ['vpp', 'vpp-plugins', 'vpp-api-java', 'vpp-api-lua', 'vpp-api-python',
+import distro
+
+ubuntu_pkgs = {'release': ['vpp', 'vpp-plugin-core', 'vpp-plugin-dpdk', 'vpp-api-python', 'python3-vpp-api',
'vpp-dbg', 'vpp-dev'],
- 'master': ['vpp', 'vpp-plugin-core', 'vpp-ext-deps', 'vpp-api-python',
- 'vpp-dbg', 'vpp-dev', 'vpp-plugin-dpdk']}
+ 'master': ['vpp', 'vpp-plugin-core', 'vpp-plugin-dpdk', 'vpp-api-python', 'python3-vpp-api',
+ 'vpp-dbg', 'vpp-dev']}
-centos_pkgs = {'release': ['vpp', 'vpp-plugins', 'vpp-api-java', 'vpp-api-lua',
+centos_pkgs = {'release': ['vpp', 'vpp-selinux-policy', 'vpp-plugins', 'vpp-api-lua',
'vpp-api-python', 'vpp-debuginfo', 'vpp-devel', 'libvpp0'],
- 'master': ['vpp', 'vpp-plugins', 'vpp-ext-deps', 'vpp-api-java', 'vpp-api-lua',
+ 'master': ['vpp', 'vpp-selinux-policy', 'vpp-plugins', 'vpp-api-lua',
'vpp-api-python', 'vpp-debuginfo', 'vpp-devel', 'libvpp0']}
return interfaces
lines = stdout.split('\n')
- if len(lines[0]) is not 0:
+ if len(lines[0]) != 0:
if lines[0].split(' ')[0] == 'FileNotFoundError':
return interfaces
name = ''
for line in lines:
- if len(line) is 0:
+ if len(line) == 0:
continue
# If the first character is not whitespace
# create a new interface
- if len(re.findall(r'\s', line[0])) is 0:
+ if len(re.findall(r'\s', line[0])) == 0:
spl = line.split()
name = spl[0]
if name == 'local0':
return interfaces
lines = stdout.split('\n')
- if len(lines[0]) is not 0:
+ if len(lines[0]) != 0:
if lines[0].split(' ')[0] == 'FileNotFoundError':
return interfaces
for line in lines:
- if len(line) is 0:
+ if len(line) == 0:
continue
# If the first character is not whitespace
# create a new interface
- if len(re.findall(r'\s', line[0])) is 0:
+ if len(re.findall(r'\s', line[0])) == 0:
spl = line.split()
name = spl[0]
interfaces[name] = {}
:rtype: list
"""
- distro = platform.linux_distribution()
- if distro[0] == 'Ubuntu' or \
- distro[0] == 'CentOS Linux' or \
- distro[:7] == 'Red Hat':
- return distro
+ dist = distro.linux_distribution()
+ if dist[0] == 'Ubuntu' or \
+ dist[0] == 'CentOS Linux' or \
+ dist[:7] == 'Red Hat':
+ return dist
else:
raise RuntimeError(
- 'Linux Distribution {} is not supported'.format(distro[0]))
+ 'Linux Distribution {} is not supported'.format(dist[0]))
@staticmethod
def version():
return version
lines = stdout.split('\n')
- if len(lines[0]) is not 0:
+ if len(lines[0]) != 0:
if lines[0].split(' ')[0] == 'FileNotFoundError':
return version
for line in lines:
- if len(line) is 0:
+ if len(line) == 0:
continue
dct = line.split(':')
version[dct[0]] = dct[1].lstrip(' ')