<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:8pt;font-family:Sans Serif">
<p>On Monday 29 September 2008 02:54:10 you wrote:</p>
<p><span style="color:#008000">> Hi!</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#007000">> > It seems that parted has changed it's error message. The error that</span></p>
<p><span style="color:#007000">> > y'all designate as parted_2 has changed format. I'm using lenny to test</span></p>
<p><span style="color:#007000">> > everything on, and I'm using fai-client 3.2.10 (due to bug #497066). I'm</span></p>
<p><span style="color:#007000">> > attaching a patch that should hopefully fix this problem, at least until</span></p>
<p><span style="color:#007000">> > they change the error message again.</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#008000">> Thanks for debugging this!</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#007000">> > Also, it seems that the -d switch isn't working, although export debug=1</span></p>
<p><span style="color:#007000">> > works just fine.</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#008000">> Ok, I'll look into this one.</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#007000">> > Index: lib/setup-storage/Exec.pm</span></p>
<p><span style="color:#007000">> > ===================================================================</span></p>
<p><span style="color:#007000">> > --- lib/setup-storage/Exec.pm        (revision 5150)</span></p>
<p><span style="color:#007000">> > +++ lib/setup-storage/Exec.pm        (working copy)</span></p>
<p><span style="color:#007000">> > @@ -61,8 +61,8 @@</span></p>
<p><span style="color:#007000">> > {</span></p>
<p><span style="color:#007000">> > error => "parted_2",</span></p>
<p><span style="color:#007000">> > message => "Parted could not read a disk label\n",</span></p>
<p><span style="color:#007000">> > - stderr_regex => "Error: Unable to open .* - unrecognised disk</span></p>
<p><span style="color:#007000">> > label", - stdout_regex => "",</span></p>
<p><span style="color:#007000">> > + stdout_regex => "Error: .* unrecognised disk label",</span></p>
<p><span style="color:#007000">> > + stderr_regex => "",</span></p>
<p><span style="color:#007000">> > program => "parted",</span></p>
<p><span style="color:#007000">> > response => "warn",</span></p>
<p><span style="color:#007000">> > },</span></p>
<p><span style="color:#008000">></span></p>
<p><span style="color:#008000">> Could you please confirm that you also tested this (I guess so, but just to</span></p>
<p><span style="color:#008000">> make sure we don't introduce an error right before the release)? The most</span></p>
<p><span style="color:#008000">> important point seems to be that the error message is now printed on stdout</span></p>
<p><span style="color:#008000">> instead of stderr. As Andreas suggested, I'll try to modify this patch such</span></p>
<p><span style="color:#008000">> that it works for both, the old and the new version.</span></p>
<p><span style="color:#008000">></span></p>
<p>I've been using it for a while now. I made my own package (3.2.10+<span style="color:#ff0000">nmu</span>1), and I've been using it since the 13th. I haven't used it with <span style="color:#ff0000">fai</span>, but as a standalone application. What I've been doing is calling setup-storage -X -f filename .</p>
<p></p>
<p>here's the code I've been using</p>
<p></p>
<p>-------------------------------------------------</p>
<p># disklist is a python list</p>
<p># disk_config is a string that's written to a file</p>
<p><span style="color:#ff0000">def</span> setup_storage_<span style="color:#ff0000">fai</span>(disklist, disk_config, <span style="color:#ff0000">logdir</span>,</p>
<p> script='/<span style="color:#ff0000">usr</span>/<span style="color:#ff0000">sbin</span>/setup-storage'):</p>
<p> <span style="color:#ff0000">fileid</span>, disk_config_path = tempfile.<span style="color:#ff0000">mkstemp</span>('<span style="color:#ff0000">paella</span>', 'diskinfo')</p>
<p> disk_config_file = file(disk_config_path, 'w')</p>
<p> disk_config_file.write(disk_config)</p>
<p> disk_config_file.close()</p>
<p> options = ['-X', '-f', disk_config_path]</p>
<p> <span style="color:#ff0000">env</span> = ['<span style="color:#ff0000">env</span>', '<span style="color:#ff0000">LOGDIR</span>=%s' % <span style="color:#ff0000">logdir</span>,</p>
<p> 'disklist=%s' % '\n'.join(disklist)</p>
<p> ]</p>
<p> if 'DEBUG' in <span style="color:#ff0000">os</span>.environ:</p>
<p> <span style="color:#ff0000">env</span>.append('debug=1')</p>
<p> command = <span style="color:#ff0000">env</span> + [script] + options</p>
<p> return command</p>
<p>-------------------------------------------------</p>
<p>example: </p>
<p>diskconfig = "...contents of diskconfig file..."</p>
<p>command = setup_storage_fai(['hda', 'hdb'], diskconfig, /path/to/logdir)</p>
<p>retval = subprocess.call(command)</p>
<p>if retval:</p>
<p>        raise error</p>
<p>I then use the generated fstab on the system</p>
<p></p>
<p>I'm telling you this, because it may be the case that stdout is redirected to stderr by mistake somewhere behind the scenes in fai, and the bug I mentioned may not even show up in fai, but it definitely appears when using setup-storage as a standalone script.</p>
<p></p>
<p></p>
<p><span style="color:#008000">> Thanks,</span></p>
<p><span style="color:#008000">> Michael</span></p>
<p></p>
<p></p>
<p></p>
<p>-- </p>
<p>Thanks:</p>
<p>Joseph Rawson</p>
</body></html>