From 7a789740538ce5b370f9a29fffdddffbc89634d0 Mon Sep 17 00:00:00 2001 From: Ahmad Bilal Khalid Date: Mon, 1 Jul 2019 23:55:52 +0500 Subject: [PATCH] owner + file_path fixed --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index cf54b20..acf173f 100644 --- a/main.py +++ b/main.py @@ -54,8 +54,7 @@ for file in untracked_files: file_id = uuid4() # Get Username - owner = pathlib.Path(file).parts[2] - + owner = pathlib.Path(file).parts[3] # Get Creation Date of File # Here, we are assuming that ctime is creation time # which is mostly not true. @@ -68,7 +67,7 @@ for file in untracked_files: sha_sum = sha512sum(file) # File Path excluding base and username - file_path = pathlib.Path(file).parts[3:] + file_path = pathlib.Path(file).parts[4:] file_path = os.path.join(*file_path) # Create Entry @@ -81,7 +80,6 @@ for file in untracked_files: } print(f"Tracking {file}") - # Insert Entry etcd_client.put(entry_key, entry_value, value_in_json=True) xattr.setxattr(file, b"user.utracked", b"True")