Bug 693324 - sfdisk's python interface only accepts lists of type 'list' for the lines parameter
sfdisk's python interface only accepts lists of type 'list' for the lines par...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks: 693306
  Show dependency treegraph
 
Reported: 2011-04-04 06:30 EDT by Richard W.M. Jones
Modified: 2011-04-11 06:18 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 693306
Environment:
Last Closed: 2011-04-04 07:49:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2011-04-04 06:30:18 EDT
+++ This bug was initially created as a clone of Bug #693306 +++

Description of problem:
I'm using a network proxy to call libguestfs' python interface (specifically: rpyc), and sfdisk rejects its list look-alike

It can be solved very simply by changing the code like:
-       return libguestfsmod.sfdisk (self._o, device, cyls, heads, sectors, lines)
+       return libguestfsmod.sfdisk (self._o, device, cyls, heads, sectors, list(lines))

It won't affect existing code, and it will accept any iterable instead of throwing a RuntimeError.



Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

--- Additional comment from pm-rhel@redhat.com on 2011-04-04 05:52:01 EDT ---

Since this issue was entered in bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from pm-rhel@redhat.com on 2011-04-04 05:53:17 EDT ---

Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.
Comment 1 Richard W.M. Jones 2011-04-04 06:34:25 EDT
http://docs.python.org/library/functions.html#list
Comment 2 Richard W.M. Jones 2011-04-04 07:49:04 EDT
This commit appears to work for me:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=afa17809599f3ebc82c3feef025ca812fb26c9fe

It changes the generated code something like this:

[...]
@@ -1771,6 +1772,7 @@
         u"""This creates an LVM volume group called "volgroup" from
         the non-empty list of physical volumes "physvols".
         """
+        physvols = list (physvols)
         return libguestfsmod.vgcreate (self._o, volgroup, physvols)
 
     def lvcreate (self, logvol, volgroup, mbytes):
@@ -1815,6 +1817,7 @@
         This command is dangerous. Without careful use you can
         easily destroy all your data.
         """
+        lines = list (lines)
         return libguestfsmod.sfdisk (self._o, device, cyls, heads, sectors, lines)
 
     def write_file (self, path, content, size):
[...]
Comment 3 Richard W.M. Jones 2011-04-11 06:18:13 EDT
Fix will be included in stable branch version 1.8.5.

Note You need to log in before you can comment on or make changes to this bug.