Bug 717677

Summary: Allow to call set() method with None value
Product: [Fedora] Fedora Reporter: Roman Rakus <rrakus>
Component: python-augeasAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: harald, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-augeas-0.4.1-1.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-22 01:57:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Allows None value in set() method
none
proposed patch for upstream git none

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.