Blob Blame History Raw
From 187b7110584830c9c7ea5cfb6e720315d3ba150a Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 11 Jan 2010 13:18:21 +0100
Subject: [PATCH] Remove py_disk_clobber_exclude binding

py_disk_clobber_exclude has been removed from libparted-2.1, which is the
release we are targetting, so remove the binding for it.
---
 include/docstrings/pydevice.h  |    6 -----
 include/pydisk.h               |    1 -
 include/typeobjects/pydevice.h |    2 -
 src/parted/device.py           |   12 ++--------
 src/pydisk.c                   |   41 ----------------------------------------
 5 files changed, 3 insertions(+), 59 deletions(-)

diff --git a/include/docstrings/pydevice.h b/include/docstrings/pydevice.h
index c581329..a837049 100644
--- a/include/docstrings/pydevice.h
+++ b/include/docstrings/pydevice.h
@@ -112,12 +112,6 @@ PyDoc_STRVAR(disk_clobber_doc,
 "Remove all identifying information from a partition table.  If the partition\n"
 "table cannot be cleared, a _ped.DiskException is raised.");
 
-PyDoc_STRVAR(disk_clobber_exclude_doc,
-"clobber_exclude(self, DiskType) -> boolean\n\n"
-"Remove all identifiying information from a partition table except for tables\n"
-"of the given DiskType.  If the partition table cannot be cleared, a\n"
-"_ped.DiskException is raised.");
-
 PyDoc_STRVAR(device_get_constraint_doc,
 "get_constraint(self) -> Constraint\n\n"
 "Get a constraint that represents hardware requirements on geometry.\n"
diff --git a/include/pydisk.h b/include/pydisk.h
index 7580634..9b9115d 100644
--- a/include/pydisk.h
+++ b/include/pydisk.h
@@ -104,7 +104,6 @@ PyObject *py_ped_disk_type_get_next(PyObject *, PyObject *);
 PyObject *py_ped_disk_type_get(PyObject *, PyObject *);
 PyObject *py_ped_disk_type_check_feature(PyObject *, PyObject *);
 PyObject *py_ped_disk_clobber(PyObject *, PyObject *);
-PyObject *py_ped_disk_clobber_exclude(PyObject *, PyObject *);
 PyObject *py_ped_disk_duplicate(PyObject *, PyObject *);
 PyObject *py_ped_disk_destroy(PyObject *, PyObject *);
 PyObject *py_ped_disk_commit(PyObject *, PyObject *);
diff --git a/include/typeobjects/pydevice.h b/include/typeobjects/pydevice.h
index e97f633..56a8f19 100644
--- a/include/typeobjects/pydevice.h
+++ b/include/typeobjects/pydevice.h
@@ -158,8 +158,6 @@ static PyMethodDef _ped_Device_methods[] = {
      */
     {"clobber", (PyCFunction) py_ped_disk_clobber, METH_VARARGS,
                 disk_clobber_doc},
-    {"clobber_exclude", (PyCFunction) py_ped_disk_clobber_exclude,
-                        METH_VARARGS, disk_clobber_exclude_doc},
 
     /*
      * These functions are in pyfilesys.c, but they work best
diff --git a/src/parted/device.py b/src/parted/device.py
index 3ab536d..87f0aa1 100644
--- a/src/parted/device.py
+++ b/src/parted/device.py
@@ -181,15 +181,9 @@ class Device(object):
         return s
 
     @localeC
-    def clobber(self, type=None):
-        """Remove all identifying signatures of the partition table.  If type
-           is not None, remove all identifying signatures of the partition
-           table, except for partition tables of that type.  type must be a
-           string matching a valid key in the diskType hash."""
-        if type is None:
-            return self.__device.clobber()
-        else:
-            return self.__device.clobber_exclude(diskType[type])
+    def clobber(self):
+        """Remove all identifying signatures of the partition table."""
+        return self.__device.clobber()
 
     @localeC
     def open(self):
diff --git a/src/pydisk.c b/src/pydisk.c
index e49a57c..6ca5279 100644
--- a/src/pydisk.c
+++ b/src/pydisk.c
@@ -651,47 +651,6 @@ PyObject *py_ped_disk_clobber(PyObject *s, PyObject *args) {
     }
 }
 
-PyObject *py_ped_disk_clobber_exclude(PyObject *s, PyObject *args) {
-    PyObject *in_disktype = NULL;
-    PedDevice *device = NULL;
-    PedDiskType *out_disktype = NULL;
-    int ret = 0;
-
-    if (!PyArg_ParseTuple(args, "O!", &_ped_DiskType_Type_obj, &in_disktype)) {
-        return NULL;
-    }
-
-    device = _ped_Device2PedDevice(s);
-    if (device == NULL) {
-        return NULL;
-    }
-
-    out_disktype = _ped_DiskType2PedDiskType(in_disktype);
-    if (out_disktype == NULL) {
-        return NULL;
-    }
-
-    ret = ped_disk_clobber_exclude(device, out_disktype);
-    if (ret == 0) {
-        if (partedExnRaised) {
-            partedExnRaised = 0;
-
-            if (!PyErr_ExceptionMatches(PartedException) &&
-                !PyErr_ExceptionMatches(PyExc_NotImplementedError))
-                PyErr_SetString(IOException, partedExnMessage);
-        }
-        else
-            PyErr_Format(DiskException, "Failed to clobber partition table on device %s", device->path);
-        return NULL;
-    }
-
-    if (ret) {
-        Py_RETURN_TRUE;
-    } else {
-        Py_RETURN_FALSE;
-    }
-}
-
 /* XXX: is this necessary? */
 PyObject *py_ped_disk_duplicate(PyObject *s, PyObject *args) {
     PedDisk *disk = NULL, *pass_disk = NULL;
-- 
1.6.5.2