xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Scott <dave.scott@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: David Scott <dave.scott@citrix.com>,
	David Scott <dave.scott@eu.citrix.com>,
	stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
	boris.ostrovsky@oracle.com, ian.campbell@citrix.com
Subject: [PATCH] pygrub: fix non-interactive parsing of grub1 config files
Date: Mon, 8 Sep 2014 15:01:25 +0100	[thread overview]
Message-ID: <1410184885-27359-1-git-send-email-dave.scott@citrix.com> (raw)

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)]
     except IndexError:
         img = g.cf.images[0]
 
-- 
1.7.10.4

             reply	other threads:[~2014-09-08 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 14:01 David Scott [this message]
2014-09-08 17:11 ` [PATCH] pygrub: fix non-interactive parsing of grub1 config files Boris Ostrovsky
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=1410184885-27359-1-git-send-email-dave.scott@citrix.com \
    --to=dave.scott@citrix.com \
    --cc=boris.ostrovsky@oracle.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).