Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def try_int(i):
# a2 before a10 in sorting
# https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/
def natural_sorted_key(val):
return [int(c) if c.isdigit() else c for c in re.split('(\d+)', val)]
return [int(c) if c.isdigit() else c for c in re.split('(\\d+)', val)]

def filter_none(seq):
return filter(lambda x: x is not None, seq)
Expand Down
8 changes: 4 additions & 4 deletions scripts/dpdk_nic_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def find_module(mod):

# check for a copy based off current path
drivers_dir = '/lib/modules/%s/kernel/drivers' % kernel_ver
find_out = check_output(["find", drivers_dir, "-name", mod + ".ko\*"], universal_newlines = True)
find_out = check_output(["find", drivers_dir, "-name", mod + ".ko\\*"], universal_newlines = True)
if find_out: #something matched
path = find_out.splitlines()[0]
if exists(path):
Expand Down Expand Up @@ -819,7 +819,7 @@ def get_info_from_trex(pci_addr_list):
else:
print('Error upon running TRex to get interfaces info:\n%s' % stdout)
sys.exit(-1)
pci_mac_str = 'PCI: (\S+).+?MAC: (\S+).+?Driver: (\S*)'
pci_mac_str = 'PCI: (\\S+).+?MAC: (\\S+).+?Driver: (\\S*)'
pci_mac_re = re.compile(pci_mac_str)
for line in stdout.splitlines():
match = pci_mac_re.match(line)
Expand Down Expand Up @@ -879,8 +879,8 @@ def show_table(get_macs = True,show_table=True):
MEGA = 1000000
GIGA = 1000000000
TERA = 1000000000000
MEMORY_SIZE_RE = re.compile('(\d+)\s*(.?)b?$')
BANK_LOCATOR_RE = re.compile('(node|cpu) (\d+) channel (\d+)')
MEMORY_SIZE_RE = re.compile('(\\d+)\\s*(.?)b?$')
BANK_LOCATOR_RE = re.compile('(node|cpu) (\\d+) channel (\\d+)')
def parse_memory_section(section, flag_hypervisor):
numa = channel = size = None
for line in section.splitlines():
Expand Down
6 changes: 3 additions & 3 deletions scripts/dpdk_setup_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def if_list_remove_sub_if(if_list):

class ConfigCreator(object):
mandatory_interface_fields = ['Slot_str', 'Device_str', 'NUMA']
_2hex_re = '[\da-fA-F]{2}'
_2hex_re = '[\\da-fA-F]{2}'
mac_re = re.compile('^({0}:){{5}}{0}$'.format(_2hex_re))

if march == 'ppc64le':
Expand Down Expand Up @@ -510,7 +510,7 @@ def disable_flow_control_mlx_device (self,dev_id):
def check_ofed_version (self):
ofed_info='/usr/bin/ofed_info'

ofed_ver_re = re.compile('.*[-](\d)(\d)?[.](\d)(\d)?[-].*')
ofed_ver_re = re.compile('.*[-](\\d)(\\d)?[.](\\d)(\\d)?[-].*')

ofed_ver = 52
ofed_ver_show = '5.2'
Expand Down Expand Up @@ -862,7 +862,7 @@ def check_vdev(self, if_list):
if not if_list:
return
af_names = []
ifname_re = re.compile('iface\s*=\s*([^\s,]+)')
ifname_re = re.compile('iface\\s*=\\s*([^\\s,]+)')
found_vdev = False
found_pdev = False
for iface in if_list:
Expand Down