From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Scott Subject: [PATCH] pygrub: fix non-interactive parsing of grub1 config files Date: Mon, 8 Sep 2014 15:01:25 +0100 Message-ID: <1410184885-27359-1-git-send-email-dave.scott@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XQzXC-0003av-NB for xen-devel@lists.xenproject.org; Mon, 08 Sep 2014 14:03:10 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: David Scott , David Scott , stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, boris.ostrovsky@oracle.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org From: David Scott 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 --- 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