Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
bawi
bybawi, July 12, 2024
Adding to charles123 review on python3
on 3.6.9 it doesn't work as expected because in "text" argument didn't exist in Popen yet.
in order to make it work replace "text" to "universal_newlines"
in both of these lines:
ctrl_status = Popen(['sudo', smartarray_bin, 'ctrl', 'slot=' + self.tocheck['ctrl'][i].split('Slot ')[1].split(' ')[0], 'show', 'status'], stdout=PIPE, universal_newlines=True)
hpacucli = Popen(['sudo', smartarray_bin, 'ctrl', 'all', 'show', 'config'], stdout=PIPE, universal_newlines=True)
on 3.6.9 it doesn't work as expected because in "text" argument didn't exist in Popen yet.
in order to make it work replace "text" to "universal_newlines"
in both of these lines:
ctrl_status = Popen(['sudo', smartarray_bin, 'ctrl', 'slot=' + self.tocheck['ctrl'][i].split('Slot ')[1].split(' ')[0], 'show', 'status'], stdout=PIPE, universal_newlines=True)
hpacucli = Popen(['sudo', smartarray_bin, 'ctrl', 'all', 'show', 'config'], stdout=PIPE, universal_newlines=True)