FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Desktop

 
 
LinkBack Thread Tools
 
Old 02-25-2009, 06:16 PM
Hans de Goede
 
Default PATCH : pyblock: Make first 2 args of pydm_map_init_method() mandatory

pydm_map_create() must have a valid name and table as arguments, so make the
first 2 arguments to pydm_map_init_method() mandatory.
---
dm.c | 17 +++--------------
1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/dm.c b/dm.c
index 517e2fd..cd5110b 100644
--- a/dm.c
+++ b/dm.c
@@ -877,11 +877,6 @@ pydm_map_create(PydmMapObject *map, PyObject *table)
struct dm_task *task;
int i;

- if (!map->name) {
- PyErr_SetString(PyExc_ValueError,
- "name not set when creating map");
- return -1;
- }
task = dm_task_create(DM_DEVICE_CREATE);
if (!task) {
if (!PyErr_Occurred()) {
@@ -948,23 +943,17 @@ pydm_map_init_method(PyObject *self, PyObject *args,
PyObject *kwds)


pydm_map_clear(map);

- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zO!zO!:map.__init__",
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "sO!|zO!:map.__init__",
kwlist, &name, &PyList_Type, &table, &uuid,
&PydmDevice_Type, &dev))
return -1;

- if (table && !name) {
- PyErr_SetString(PyExc_RuntimeError,
- "Cannot create device map without a name
");
- return -1;
- }
-
Py_XINCREF(dev);

+ map->name = strdup(name);
+
if (uuid)
map->uuid = strdup(uuid);
- if (name)
- map->name = strdup(name);
if (dev)
map->dev = (PyObject *)dev;

--
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org