[Pkg-xen-devel] Bug#603391: Bug#603391: Workaround PyGrub issue
Ian Campbell
ijc at hellion.org.uk
Tue Oct 1 19:03:54 UTC 2013
On Tue, 2013-10-01 at 09:10 -0700, Tril wrote:
> Sorry didn't work.
Hrm, odd, it worked when based on the upstream xen-unstable tree.
Perhaps something else is needed against 4.1 for the backport to work.
> Aso it will only handle this special case, not the
> general case of /dev/something.
Right, in this context there isn't really a general case since for
things to work with PV it has to be /dev/xvd*. The only other plausible
option might be /dev/hd* which I'm happy to fault in as and when someone
demonstrates this in practice.
> # python GrubConf.py grub2 /home/tehadmin/snail-grub.cfg
> WARNING:root:Unknown directive load_video
> WARNING:root:Unknown directive terminal_output
> WARNING:root:Unknown image directive load_video
> Traceback (most recent call last):
> File "GrubConf.py", line 467, in <module>
> g = Grub2ConfigFile(sys.argv[2])
> File "GrubConf.py", line 359, in __init__
> _GrubConfigFile.__init__(self, fn)
> File "GrubConf.py", line 179, in __init__
> self.parse()
> File "GrubConf.py", line 418, in parse
> self.add_image(Grub2Image(title, img))
> File "GrubConf.py", line 325, in __init__
> _GrubImage.__init__(self, title, lines)
> File "GrubConf.py", line 94, in __init__
> self.reset(lines)
> File "GrubConf.py", line 110, in reset
> self._parse(lines)
> File "GrubConf.py", line 105, in _parse
> map(self.set_from_line, lines)
> File "GrubConf.py", line 335, in set_from_line
> setattr(self, self.commands[com], arg.strip())
> File "GrubConf.py", line 113, in set_root
> self._root = GrubDiskPart(val)
> File "GrubConf.py", line 55, in __init__
> (self.disk, self.part) = str.split(",", 2)
> File "GrubConf.py", line 73, in set_disk
> self.disk = ord(disk)-ord('a')
> File "GrubConf.py", line 69, in set_disk
> val = val.replace("(", "").replace(")", "")
> AttributeError: 'int' object has no attribute 'replace'
Are you sure you edited the file correctly? The changes should be after
the val.replace line!
Ian.
> > diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
> > index 6324c62..cb853c9 100644
> > --- a/tools/pygrub/src/GrubConf.py
> > +++ b/tools/pygrub/src/GrubConf.py
> > @@ -67,7 +67,11 @@ class GrubDiskPart(object):
> > return self._disk
> > def set_disk(self, val):
> > val = val.replace("(", "").replace(")", "")
> > - self._disk = int(val[2:])
> > + if val.startswith("/dev/xvd"):
> > + disk = val[len("/dev/xvd")]
> > + self._disk = ord(disk)-ord('a')
> > + else:
> > + self._disk = int(val[2:])
> > disk = property(get_disk, set_disk)
> >
> > def get_part(self):
> >
> >
>
More information about the Pkg-xen-devel
mailing list