# function to run shell commands
def OSinfo(runthis):
#Run the command in the OS
osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
#Grab the stdout
theInfo = osstdout.stdout.read() #readline()
#Remove the carriage return at the end of a 1 line result
theInfo = str(theInfo).strip()
#Return the result
return theInfo
# flash raid firmware
OSinfo('MegaCli -adpfwflash -f ' + imagefile + ' -noverchk -a0')
# return status of the firmware flash
?
One resource recommended using 'subprocess.check_output()', however, I'm not sure how to incorporate this into function OSinfo().