| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
* Validate inputs during initialization of Volume object.
* Move glfs_new() and glfs_init() into mount() method.
* Provide user consumable unmount() method.
* Provide "mounted" property to Volume object. Users can now check state
whether a volume is virtual mounted or not.
Change-Id: Idc53ee7f9386ed995315bd5fb492a7d36f44875f
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usually, this failure happens in source installs of glusterfs.
find_library() is able to find the .so file but ctypes.CDLL()
cannot load it!
Refer: http://bugs.python.org/issue18502
With this change, users are advised to modify LD_LIBRARY_PATH
when exception is raised
Also, passed the LD_LIBRARY_PATH env variable to tox environment
so that unit tests and functional tests can run.
Change-Id: Iffc5633088b3886739a8534692db88db7c3d02b7
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
| |
Change-Id: I8678148961ee192d96e887b6ca7f4b8e4ba89507
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This project has to be shipped as rpm for various distributions like
Fedora,Centos,RHEL.etc, so that the clients like vdsm, openstack..etc
can make use of python bindings of libgfapi library of GlusterFS.
This patch introduce first version of the spec file for this project.
Change-Id: Icb5d83fc8b278a3cd7b89d55b5fda15a84c2fa82
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The goal is to consolidate all gluster related python packages
under single namespace "gluster".
From client's perspective, it was:
from glusterfs import gfapi
Henceforth, it wil be:
from gluster import gfapi
Change-Id: If2509f570563ae7660892963607c9474313f803c
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
|
|/
|
|
|
|
| |
Change-Id: Id61c55f1ca6fb3cc724982142abdc0120c0499b0
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|\ |
|
| |
| |
| |
| |
| | |
Change-Id: I89224d961cba538bc732682e64f0658e5b5e7d80
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Iaf2ae5a07e3ccb9919f6020f42962b4441557596
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Did not add functional tests at the moment. This function requires
superuser privilege to execute
Change-Id: I35c0a6b3eba60586da64ccfb4dc818d403542f41
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added option to read whole file if caller send -1
as the buflen to read function.
Also added a copy of getsize to File class, now called
fgetsize, which returns the size of the file as
reported by fstat
Removed flags paramater from read function as it is never
used by libgfapi.
Change-Id: Ia1c04ef9717d9ca098e1961300d6ee216381c989
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|/
|
|
|
| |
Change-Id: Iba5f4e72a257adeb8ec78b267dfdef26a1ec66f1
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
| |
tests were failing due to an issue with loremipsum package
Change-Id: I9c364f48dc7fb642f5cd7a6371a53a0aa137618b
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling mkdir without mode used to fail with following error:
>>> vol.mkdir('/c2')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: mkdir() takes exactly 3 arguments (2 given)
Python's os.mkdir() defined default mode:
https://docs.python.org/2/library/os.html#os.mkdir
Also, changed mode_t is of type unsigned short (ctypes.c_ushort).
Change-Id: I95e47a8173d90e2a162cfeb9af002ea0c20fc2ff
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This helps ctypes know the calling conventions it should use to communicate
with the binary interface of libgfapi and which types it should allocate and
cast. Without it, ctypes fails/crashes when not running on the main thread.
Change-Id: I73480229f451167377ed4d1534b08b66c689cc4f
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The order of elements in list returned by listdir() can vary and may
not be sorted. This caused assertEqual in "test_listdir" to fail.
* Also, some systems may have xattrs belonging to selinux. So, a
listxattr can list them too.
* Allow hostname/ip and volume name to be configured easily by setting
it in test.conf. This enables functional tests to use a non-local volume.
* Cleanup volume before and after running functional tests.
* Added MANIFEST.in and LICENSE file
Change-Id: Icfa6eb60e8d8e7ed4d6ab8190a2a2c80688999a3
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
|
|
|
| |
This support will help other consumers to get the statvfs
details.
Change-Id: Iee4e84a515ff80f24add812ad6fcf84c992bf356
Signed-off-by: hchiramm <hchiramm@redhat.com>
|
|
|
|
|
|
|
|
| |
This patch adds new functions that are used in gluster-swift.
These functions are: dup, lseek, getatime, getctime, getmtime
Change-Id: I09036f7e393a89e09913f7f6de173e1eca8dca95
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
| |
* Changed package to be covered from gluster to glusterfs.
* Also, added script to run unit tests without tox.
* Updated setup.py to be more specific.
Change-Id: I148f522153b75f066753a807719e38699d48b1fd
Signed-off-by: Prashanth Pai <ppai@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
the os python module does not offer a creat function,
new files are created using the open function and
by passing O_CREAT flag. We are changing gfapi.py to
function the same way.
Change-Id: I5e084b200bb657e3124d3e620a47160e790cd1fe
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
making this change to avoid package conflicts with
gluster-swift and glusterfs-api rpm. Eventually we will remove
the python code from glusterfs-api rpm and create a new rpm package
from libgfapi-python.
Change-Id: I1b20cd747e500aed17fba89f96e62423325b5230
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
There's currently an issue with the latest version of tox and
this is keeping people from running the tests. Installing the
previous version is a workaround until the problem with tox
is solved
Change-Id: I3d8a842038f6265daf42c5624ef209bf248570a6
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
| |
These new functions are required to be used by gluster-swift
Change-Id: Ifb68f2b4494bf375feabb130831f9e076dc5b94a
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
| |
Added same license as gluster-swift
Change-Id: Ib190b4e6def5d2ab87b71a04142f6344060d8a6d
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
These are mostly helper methods similar to functions provided
by the python os module
helpfer functions added: exists, getsize, isdir, isfile, islink
glfs functions added: removexattr, stat
Change-Id: I3581a96224151481292a4e506d8c52b8acf79e49
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
This text was previously provided by Justing Clift in
a pull request. Submitting now as a gerrit review.
Change-Id: I2f2bcd894c5eb58318d85b5856366ff31e2a423e
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
both functions were only supporting text data and needed to be
changed to support binary data.
The issue was found while testing libgfapi-python with smallfile
(https://github.com/bengland2/smallfile).
When calling gflfs_write, ctypes has no problem converting strings
to the correct C data type, but is unable to handle bytearray:
b = bytearray(1024)
with vol.create(path, os.O_WRONLY | os.O_EXCL, 0644) as fd:
fd.write(b)
It would throw this error:
exception: argument 2: <type 'exceptions.TypeError'>:
Don't know how to convert parameter 2
reference: http://docs.python.org/2/library/ctypes.html#calling-functions-continued
Change-Id: Ia2bb47343880cbf7121fed9510e4cfa085fe23bd
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
| |
Change-Id: I48df12b8627ef2b0c4dfedadcb90864e4a537019
Signed-off-by: Luis Pabon <lpabon@redhat.com>
|
|
|
|
|
|
|
|
| |
add mode parameter to mkdir to allow setting the dir access
mode when the directory is being created
Change-Id: I6f1ed0c8800fb65a30448e6082cf55b8220a06d4
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
Need to fix issue with libgfapi allowing only apps with
root access to mount volume
Change-Id: I21a06e6941969b34b3974dd786855bfe5cf3856b
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
adding a few functional tests and removing old
tests from source code
Change-Id: Iefcb091d614f2825592943cfb42847b5865322c6
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
xdr and glfs were not being used, so they are being
removed for now
Change-Id: I8db793f66f2f2a6442f3a6b6f53617d52cc52a92
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
| |
when creating or opening a File, caller should now
use python's with statement as specified on PEP 343:
http://www.python.org/dev/peps/pep-0343/
Change-Id: Id98613e310bea01a427769d3ad7b0dea97245b04
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
| |
added unit tests for existing methods
Change-Id: Iecd31bc1dea44ea38168120bd05ca505c4ff5c59
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
all changes in this patch were made to make the code
pep8 compliant
Change-Id: Ie05e370126ad4f48c4a4891c44b4440628fcb775
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Added error handling to all api calls.
On error from gfapi, a OSError or IOError exception
is raised
Change-Id: I9944ae6796da49e7678089c60138a67dff30887e
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
|
|
|
| |
fixed rename and rmdir tests with correct if statements
and removed tabs from test_fallocate
Change-Id: I02edd7511ba134395cba94b8f2d32b73dd936a0f
Signed-off-by: Thiago da Silva <thiago@redhat.com>
|
|
|
|
|
| |
Change-Id: I6545f0786779185bc1805643f8db0de2ac21995a
Signed-off-by: Luis Pabon <lpabon@redhat.com>
|
|
|
|
|
|
|
|
| |
This initial commit is a copy from
gluster/api/examples/gfapi.py from the glusterfs repo
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Change-Id: I4442528d5bc2ec52ed2970b818d8cb9327e36168
|
|
Signed-off-by: Luis Pabon <lpabon@redhat.com>
|