Problem with parted error

Joseph Rawson umeboshi3 at gmail.com
Mon Sep 29 21:36:42 CEST 2008


On Monday 29 September 2008 02:54:10 you wrote:
> Hi!
>
> > It seems that parted has changed it's error message.  The error that
> > y'all designate as parted_2 has changed format.  I'm using lenny to test
> > everything on, and I'm using fai-client 3.2.10 (due to bug #497066).  I'm
> > attaching a patch that should hopefully fix this problem, at least until
> > they change the error message again.
>
> Thanks for debugging this!
>
> > Also, it seems that the -d switch isn't working, although export debug=1
> > works just fine.
>
> Ok, I'll look into this one.
>
> > Index: lib/setup-storage/Exec.pm
> > ===================================================================
> > --- lib/setup-storage/Exec.pm	(revision 5150)
> > +++ lib/setup-storage/Exec.pm	(working copy)
> > @@ -61,8 +61,8 @@
> >    {
> >      error        => "parted_2",
> >      message      => "Parted could not read a disk label\n",
> > -    stderr_regex => "Error: Unable to open .* - unrecognised disk
> > label", -    stdout_regex => "",
> > +    stdout_regex => "Error: .* unrecognised disk label",
> > +    stderr_regex => "",
> >      program      => "parted",
> >      response     => "warn",
> >    },
>
> Could you please confirm that you also tested this (I guess so, but just to
> make sure we don't introduce an error right before the release)? The most
> important point seems to be that the error message is now printed on stdout
> instead of stderr. As Andreas suggested, I'll try to modify this patch such
> that it works for both, the old and the new version.
>
I've been using it for a while now.  I made my own package (3.2.10+nmu1), and I've been using it since the 13th.  I haven't used it with fai, but as a standalone application.  What I've been doing is calling setup-storage -X -f filename .

here's the code I've been using

-------------------------------------------------
# disklist is a python list
# disk_config is a string that's written to a file
def setup_storage_fai(disklist, disk_config, logdir,
                      script='/usr/sbin/setup-storage'):
    fileid, disk_config_path = tempfile.mkstemp('paella', 'diskinfo')
    disk_config_file = file(disk_config_path, 'w')
    disk_config_file.write(disk_config)
    disk_config_file.close()
    options = ['-X', '-f', disk_config_path]
    env = ['env', 'LOGDIR=%s' % logdir,
           'disklist=%s' % '\n'.join(disklist)
           ]
    if 'DEBUG' in os.environ:
        env.append('debug=1')
    command = env + [script] + options
    return command
-------------------------------------------------
example: 
diskconfig = "...contents of diskconfig file..."
command = setup_storage_fai(['hda', 'hdb'], diskconfig, /path/to/logdir)
retval = subprocess.call(command)
if retval:
	raise error
I then use the generated fstab on the system

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.


> Thanks,
> Michael



-- 
Thanks:
Joseph Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20080929/b55b3fcf/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20080929/b55b3fcf/attachment.bin 


More information about the linux-fai-devel mailing list