xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: David Scott <dave.scott@citrix.com>, xen-devel@lists.xenproject.org
Cc: David Scott <dave.scott@eu.citrix.com>,
	ian.jackson@eu.citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] pygrub: fix non-interactive parsing of grub1 config files
Date: Mon, 08 Sep 2014 13:11:49 -0400	[thread overview]
Message-ID: <540DE355.2070309@oracle.com> (raw)
In-Reply-To: <1410184885-27359-1-git-send-email-dave.scott@citrix.com>

On 09/08/2014 10:01 AM, David Scott wrote:
> From: David Scott <dave.scott@eu.citrix.com>
>
> Since c/s d1b93ea2, the type of 'sel' now depends on whether pygrub
> is run interactively or not. In non-interactive / quiet mode it is
> a string; in interactive mode it is an integer.
>
> When 'sel' is used to index an array it must be used as an integer.
>
> Signed-off-by: David Scott <dave.scott@citrix.com>
> ---
>   tools/pygrub/src/pygrub |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
> index 2618e11..f167a51 100644
> --- a/tools/pygrub/src/pygrub
> +++ b/tools/pygrub/src/pygrub
> @@ -630,7 +630,7 @@ def run_grub(file, entry, fs, cfg_args):
>           sys.exit(1)
>   
>       try:
> -        img = g.cf.images[sel]
> +        img = g.cf.images[int(sel)]

What if sel is a "true" string (i.e. a name of the kernel to boot as 
opposed to an index)? Should we do the same thing as what Grub:run() 
does to map value to index?

-boris


>       except IndexError:
>           img = g.cf.images[0]
>   

  reply	other threads:[~2014-09-08 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 14:01 [PATCH] pygrub: fix non-interactive parsing of grub1 config files David Scott
2014-09-08 17:11 ` Boris Ostrovsky [this message]
2014-09-10 12:50   ` Dave Scott
2014-10-24 21:15     ` Konrad Rzeszutek Wilk
2014-10-27 12:51       ` Simon Rowe
  -- strict thread matches above, loose matches on Subject: below --
2014-10-27 16:00 Simon Rowe
2014-10-27 16:35 ` Boris Ostrovsky
2014-11-04 10:46   ` Ian Campbell
2014-11-04 15:26     ` Konrad Rzeszutek Wilk
2014-10-28 12:38 ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540DE355.2070309@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=dave.scott@citrix.com \
    --cc=dave.scott@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).