Test for the existance of a file that might not be present on older RHEL.

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent 00b3fd8b45
commit b0794ff5f6

@ -1096,7 +1096,9 @@ class LinuxNetwork(Network):
primary = open(os.path.join(path, 'bonding', 'primary')).read()
if primary:
interfaces[device]['primary'] = primary
interfaces[device]['all_slaves_active'] = open(os.path.join(path, 'bonding', 'all_slaves_active')).read() == '1'
path = os.path.join(path, 'bonding', 'all_slaves_active')
if os.path.exists(path):
interfaces[device]['all_slaves_active'] = open(path).read() == '1'
output = subprocess.Popen(['/sbin/ip', 'addr', 'show', device], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
for line in output.split('\n'):

Loading…
Cancel
Save