[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[pyparted] Add support for new disk flag PED_DISK_PMBR_BOOT



From: "Brian C. Lane" <bcl redhat com>

parted can now set the boot flag on the GPT PMBR parition. Add support
for this new disk flag.
---
 src/_pedmodule.c        |    1 +
 src/parted/__init__.py  |    1 +
 tests/test__ped_disk.py |    2 +-
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/_pedmodule.c b/src/_pedmodule.c
index 8604556..3f3948b 100644
--- a/src/_pedmodule.c
+++ b/src/_pedmodule.c
@@ -512,6 +512,7 @@ PyMODINIT_FUNC init_ped(void) {
     PyModule_AddIntConstant(m, "PARTITION_LEGACY_BOOT", PED_PARTITION_LEGACY_BOOT);
 
     PyModule_AddIntConstant(m, "DISK_CYLINDER_ALIGNMENT", PED_DISK_CYLINDER_ALIGNMENT);
+    PyModule_AddIntConstant(m, "DISK_PMBR_BOOT", PED_DISK_PMBR_BOOT);
 
     PyModule_AddIntConstant(m, "DISK_TYPE_EXTENDED", PED_DISK_TYPE_EXTENDED);
     PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_NAME", PED_DISK_TYPE_PARTITION_NAME);
diff --git a/src/parted/__init__.py b/src/parted/__init__.py
index 5ca37e8..1120710 100644
--- a/src/parted/__init__.py
+++ b/src/parted/__init__.py
@@ -117,6 +117,7 @@ from _ped import PARTITION_DIAG
 from _ped import PARTITION_LEGACY_BOOT
 
 from _ped import DISK_CYLINDER_ALIGNMENT
+from _ped import DISK_PMBR_BOOT
 
 from _ped import DISK_TYPE_EXTENDED
 from _ped import DISK_TYPE_PARTITION_NAME
diff --git a/tests/test__ped_disk.py b/tests/test__ped_disk.py
index df92d51..1f8c220 100755
--- a/tests/test__ped_disk.py
+++ b/tests/test__ped_disk.py
@@ -143,7 +143,7 @@ class DiskIsFlagAvailableTestCase(RequiresDisk):
         # We don't know which flags should be available and which shouldn't,
         # but we can at least check that there aren't any tracebacks from
         # trying all of the valid ones.
-        for flag in [_ped.DISK_CYLINDER_ALIGNMENT]:
+        for flag in [_ped.DISK_CYLINDER_ALIGNMENT, _ped.DISK_PMBR_BOOT]:
             self.assertTrue(isinstance(self._disk.is_flag_available(flag), bool))
 
         # However, an invalid flag should definitely not be available.
-- 
1.7.6.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]