From 454bd09b8befc27552591855a8d02a0ad19877d9 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 18 Jun 2015 00:21:59 +0200 Subject: rpm: include required directory for glusterfind The directory was marked as %ghost, which causes the following installation failure: Error unpacking rpm package glusterfs-server-3.8dev-0.446.git45e13fe.el7.centos.x86_64 error: unpacking of archive failed on file /var/lib/glusterd/hooks/1/delete/post/S57glusterfind-delete-post.py;5581f20e: cpio: open Also, *all* Python files should be part of the RPM package. This includes generated .pyc and .pyo files. BUG: 1225465 Change-Id: Iee74905b101912c4a845257742c470c3fe42ce2a Signed-off-by: Niels de Vos Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/11298 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- extras/hook-scripts/Makefile.am | 6 +-- extras/hook-scripts/S57glusterfind-delete-post.py | 60 ----------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100755 extras/hook-scripts/S57glusterfind-delete-post.py (limited to 'extras') diff --git a/extras/hook-scripts/Makefile.am b/extras/hook-scripts/Makefile.am index f291261d123..771b37e3fdf 100644 --- a/extras/hook-scripts/Makefile.am +++ b/extras/hook-scripts/Makefile.am @@ -1,11 +1,7 @@ -EXTRA_DIST = S40ufo-stop.py S56glusterd-geo-rep-create-post.sh \ - S57glusterfind-delete-post.py +EXTRA_DIST = S40ufo-stop.py S56glusterd-geo-rep-create-post.sh SUBDIRS = add-brick set start stop reset scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/gsync-create/post/ if USE_GEOREP scripts_SCRIPTS = S56glusterd-geo-rep-create-post.sh endif - -deletehookscriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/delete/post/ -deletehookscripts_SCRIPTS = S57glusterfind-delete-post.py diff --git a/extras/hook-scripts/S57glusterfind-delete-post.py b/extras/hook-scripts/S57glusterfind-delete-post.py deleted file mode 100755 index 70edb563320..00000000000 --- a/extras/hook-scripts/S57glusterfind-delete-post.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python -import os -import shutil -from errno import ENOENT -from subprocess import Popen, PIPE -from argparse import ArgumentParser - - -DEFAULT_GLUSTERD_WORKDIR = "/var/lib/glusterd" - - -def handle_rm_error(func, path, exc_info): - if exc_info[1].errno == ENOENT: - return - - raise exc_info[1] - - -def get_glusterd_workdir(): - p = Popen(["gluster", "system::", "getwd"], - stdout=PIPE, stderr=PIPE) - - out, _ = p.communicate() - - if p.returncode == 0: - return out.strip() - else: - return DEFAULT_GLUSTERD_WORKDIR - - -def get_args(): - parser = ArgumentParser(description="Volume delete post hook script") - parser.add_argument("--volname") - return parser.parse_args() - - -def main(): - args = get_args() - glusterfind_dir = os.path.join(get_glusterd_workdir(), "glusterfind") - - # Check all session directories, if any directory found for - # the deleted volume, cleanup all the session directories - for session in os.listdir(glusterfind_dir): - # Possible session directory - volume_session_path = os.path.join(glusterfind_dir, - session, - args.volname) - if os.path.exists(volume_session_path): - shutil.rmtree(volume_session_path, onerror=handle_rm_error) - - # Try to Remove directory, if any other dir exists for different - # volume, then rmdir will fail with ENOTEMPTY which is fine - try: - os.rmdir(os.path.join(glusterfind_dir, session)) - except (OSError, IOError): - pass - - -if __name__ == "__main__": - main() -- cgit