Bug 1196161

Summary: libgfapi-python: Errno not populated properly by ctypes
Product: [Community] GlusterFS Reporter: Prashanth Pai <ppai>
Component: libgfapi-pythonAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: mainlineCC: alpha, bugs, gluster-bugs, lmohanty, ndevos, thiago
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-16 06:19:51 UTC Type: Bug
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
Expose Errno PR none

Description Prashanth Pai 2015-02-25 12:08:35 UTC
Description of problem:

Steps to Reproduce:
[root@vm0 libgfapi-python]# python
Python 2.7.5 (default, Jun 25 2014, 10:19:55) 
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from glusterfs import gfapi
>>> v = gfapi.Volume("vm0", "test")
>>> v.mount()
0
>>> v.stat('/a')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "glusterfs/gfapi.py", line 558, in stat
    raise OSError(err, os.strerror(err))
OSError: [Errno 0] Success
>>> 

Expected results:
Proper errno to be set. In the above example errno to be ENOENT.

Some additional info:

Comment 1 Alphadelta14 2015-08-30 05:28:06 UTC
Created attachment 1068383 [details]
Expose Errno PR

Patch to expose errno to foreign functions in gfapi in PR https://github.com/gluster/libgfapi-python/pull/7

Comment 2 Prashanth Pai 2015-11-16 06:19:51 UTC
This has been fixed by Alphadelta14 here: http://review.gluster.org/#/c/12051/