On 9/4/07, <b class="gmail_sendername">Mark McLoughlin</b> &lt;<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;(status, output) = commands.getstatusoutput(&quot;/sbin/dumpe2fs -h /dev/root&quot;)</blockquote><div><br>&nbsp;</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 =)&nbsp; 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&#39;s even remembered, and if it&#39;s not then you have weird failures and in other software security problems).
<br><br>The &quot;subprocess&quot; module is the fix:<br><br>output = subprocess.Popen([&#39;/sbin/dumpe2fs&#39;, &#39;-h&#39;, &#39;/dev/root&#39;], stdout=subprocess.PIPE).communicate()[0]<br><br><br><br></div><br></div>
<br>