On 9/4/07, <b class="gmail_sendername">Mark McLoughlin</b> <<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>    (status, output) = commands.getstatusoutput("/sbin/dumpe2fs -h /dev/root")</blockquote><div><br> </div><div>Not directly related to your discussion, but personally I am fairly fanatical about never involving /bin/sh in - well, anything if I can avoid it =)  Here it will be fine, but then maybe someone comes along later and wants to add a user-passed parameter to the command, and then you need to quote (if it's even remembered, and if it's not then you have weird failures and in other software security problems).
<br><br>The "subprocess" module is the fix:<br><br>output = subprocess.Popen(['/sbin/dumpe2fs', '-h', '/dev/root'], stdout=subprocess.PIPE).communicate()[0]<br><br><br><br></div><br></div>
<br>