Bug 717677 - Allow to call set() method with None value
Summary: Allow to call set() method with None value
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-augeas
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-29 14:45 UTC by Roman Rakus
Modified: 2014-01-13 00:13 UTC (History)
2 users (show)

Fixed In Version: python-augeas-0.4.1-1.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-22 01:57:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Allows None value in set() method (859 bytes, patch)
2011-06-29 14:47 UTC, Roman Rakus
no flags Details | Diff
proposed patch for upstream git (1.21 KB, patch)
2011-06-30 14:26 UTC, Harald Hoyer
no flags Details | Diff

Description Roman Rakus 2011-06-29 14:45:44 UTC
Description of problem:
It's not possible to set None (NULL in C) value in method set().
From the API doc:
If no node exists for PATH, one is created, including intermediate nodes, and its value is set to VALUE, which may be NULL.

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

How reproducible:
always

Steps to Reproduce:
# python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from augeas import Augeas
>>> a=Augeas()
>>> a.set("/files/etc/kdump.conf/options/module1/new", "val")
>>> a.save()
>>> a.set("/files/etc/kdump.conf/options/module1/new", None)

Actual results:
Traceback

Expected results:
Creates the nodes and set value to NULL.

Additional info:
Will attach a patch

Comment 1 Roman Rakus 2011-06-29 14:47:11 UTC
Created attachment 510480 [details]
Allows None value in set() method

Promised patch.

Comment 2 Harald Hoyer 2011-06-30 14:26:26 UTC
Created attachment 510688 [details]
proposed patch for upstream git

patch for http://git.fedorahosted.org/git/?p=python-augeas.git

Would that work?

Comment 3 Roman Rakus 2011-06-30 15:51:49 UTC
Yep it works. Thanks.

Comment 4 Fedora Update System 2012-01-21 03:45:52 UTC
python-augeas-0.4.1-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/python-augeas-0.4.1-1.fc16

Comment 5 Fedora Update System 2012-01-22 05:26:49 UTC
Package python-augeas-0.4.1-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-augeas-0.4.1-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0771/python-augeas-0.4.1-1.fc16
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-02-22 01:57:51 UTC
python-augeas-0.4.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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