Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix: use pci/rescan to avoid occasional bind issue on Centos7
[csit.git]
/
resources
/
libraries
/
python
/
InterfaceUtil.py
diff --git
a/resources/libraries/python/InterfaceUtil.py
b/resources/libraries/python/InterfaceUtil.py
index
ff9ecde
..
e5597b9
100644
(file)
--- a/
resources/libraries/python/InterfaceUtil.py
+++ b/
resources/libraries/python/InterfaceUtil.py
@@
-348,8
+348,14
@@
class InterfaceUtil(object):
ssh = SSH()
ssh.connect(node)
ssh = SSH()
ssh.connect(node)
- cmd = 'lspci -vmmks {0}'.format(pci_addr)
+ # First rescan PCI devices in the system
+ cmd = 'sh -c "echo 1 > /sys/bus/pci/rescan"'
+ (ret_code, _, _) = ssh.exec_command_sudo(cmd)
+ if int(ret_code) != 0:
+ raise RuntimeError("'{0}' failed on '{1}'"
+ .format(cmd, node['host']))
+ cmd = 'lspci -vmmks {0}'.format(pci_addr)
(ret_code, stdout, _) = ssh.exec_command(cmd)
if int(ret_code) != 0:
raise RuntimeError("'{0}' failed on '{1}'"
(ret_code, stdout, _) = ssh.exec_command(cmd)
if int(ret_code) != 0:
raise RuntimeError("'{0}' failed on '{1}'"