From e5b5450c4f12dde280939dd30146f5d653089f18 Mon Sep 17 00:00:00 2001 From: gilles-degols Date: Tue, 9 Apr 2019 00:04:36 +0200 Subject: [PATCH] Increase version number to 1.2.3-0 --- readme.md | 2 +- spec/mongofs.spec | 18 +++++++++++++----- src/main.py | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) mode change 100644 => 100755 src/main.py diff --git a/readme.md b/readme.md index 26577be..1e84b99 100755 --- a/readme.md +++ b/readme.md @@ -63,7 +63,7 @@ sudo mongofs-mount /mnt/data We assume that you already have a MongoDB installation, otherwise, follow the procedure described here: https://docs.mongodb.com/manual/installation/ ``` git clone git@github.com:gilles-degols/mongofs.git -yum -y install python36u fuse fuse-libs +yum -y install python36 fuse fuse-libs python3 -m ensurepip --default-pip python3 -m pip install --upgrade pip python3 -m pip uninstall fuse # Otherwise conflicts can happen with fusepy diff --git a/spec/mongofs.spec b/spec/mongofs.spec index a2c51ac..c51396a 100755 --- a/spec/mongofs.spec +++ b/spec/mongofs.spec @@ -1,9 +1,12 @@ %define debug_package %{nil} %global _python_bytecompile_errors_terminate_build 0 +%define __python /usr/bin/python3.6 -%{!?_release: %define _version 1.2.2 } +%{!?_release: %define _version 1.2.3 } %{!?_release: %define _release 0 } -# %{!?_src: %define _src %{_version}-%{_release} } + +# Following line is needed if you compile +%{!?_src: %define _src %{_version}-%{_release} } Name: mongofs Version: %{_version} @@ -38,7 +41,6 @@ getent passwd mongofs >/dev/null || useradd -r -g mongofs -d / -s /sbin/nologin %install rm -rf ${RPM_BUILD_ROOT} - install -d -m 0755 ${RPM_BUILD_ROOT}/usr/lib/mongofs install -d -m 0755 ${RPM_BUILD_ROOT}/usr/bin cp -r src/ ${RPM_BUILD_ROOT}/usr/lib/mongofs @@ -53,7 +55,11 @@ chmod +x ${RPM_BUILD_ROOT}/usr/lib/mongofs/run %define VPATH ${RPM_BUILD_ROOT}/usr/lib/mongofs/environment %define REQUIREMENTS_PATH requirements.txt -/usr/bin/python3.6 -m pip install virtualenv + +# If you upgrade from pip 8.1.2 to 19.0.3, you will get a nice bug below, which only happens in a spec file for whatever +# reason. So we assume that we have the virtualenv installed (should always be the case) +# /usr/bin/python3.6 -m pip install virtualenv + /usr/bin/python3.6 -m virtualenv --python=python3.6 %{VPATH}/virtualenv /usr/bin/python3.6 -m virtualenv --python=python3.6 --relocatable --distribute %{VPATH}/virtualenv @@ -72,7 +78,6 @@ find %{VPATH}/virtualenv/lib/python3.6/site-packages/ -type f -exec sed -i "s|%{ find %{VPATH}/virtualenv -name '*.py[co]' -delete sed -i "s|%{VPATH}|../..|g" %{VPATH}/virtualenv/bin/* - %clean rm -rf ${RPM_BUILD_ROOT} @@ -83,6 +88,9 @@ rm -rf ${RPM_BUILD_ROOT} %config /etc/mongofs/mongofs.json %changelog +* Mon Apr 08 2019 Gilles Degols - 1.2.3-0 +- Fix the lock system of files between nodes + * Sat Jan 19 2019 Gilles Degols - 1.2.2-0 - Proper RPM packaging and fix unit tests diff --git a/src/main.py b/src/main.py old mode 100644 new mode 100755 index f626933..efbf9e2 --- a/src/main.py +++ b/src/main.py @@ -58,7 +58,7 @@ def lock(self, path, fh, cmd, lock): lock_type = lock_type_pointer[0] if cmd == fcntl.F_GETLK: - blocking = test_lock_and_get_first_blocking(filepath=path, lock={'type': lock_type}) + blocking = self.mongo.test_lock_and_get_first_blocking(filepath=path, lock={'type': lock_type}) if blocking is None: # We modify the pointer by setting F_UNLCK lock_type_pointer[0] = fcntl.F_UNLCK