In working copy I've changed the type of subvol_id in the docstring to int (not int or
str).
A single type for subvol_id will be a convenience when the function is implemented in
libblockdev, in C.
- mulhern
----- Original Message -----
From: "mulhern" <amulhern(a)redhat.com>
To: anaconda-patches(a)lists.fedorahosted.org
Cc: "mulhern" <amulhern(a)redhat.com>
Sent: Thursday, October 9, 2014 2:36:05 PM
Subject: [blivet:rhel7/f21/master] Convert int to str before passing it to run_program
(#1151129)
Resolves: fed#1151129
Related: rhbz#1076383
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicelibs/btrfs.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/blivet/devicelibs/btrfs.py b/blivet/devicelibs/btrfs.py
index 94aefaa..b23306e 100644
--- a/blivet/devicelibs/btrfs.py
+++ b/blivet/devicelibs/btrfs.py
@@ -152,10 +152,16 @@ def get_default_subvolume(mountpoint):
return default
def set_default_subvolume(mountpoint, subvol_id):
+ """ Sets the subvolume of mountpoint which is mounted as default.
+
+ :param str mountpoint: path of mountpoint
+ :param subvol_id: the subvolume id to set as the default
+ :type subvol_id: str or int
+ """
if not os.path.ismount(mountpoint):
raise ValueError("volume not mounted")
- args = ["subvol", "set-default", subvol_id, mountpoint]
+ args = ["subvol", "set-default", str(subvol_id), mountpoint]
return btrfs(args)
def create_snapshot(source, dest, ro=False):
--
1.9.3