owner + file_path fixed

This commit is contained in:
ahmadbilalkhalid 2019-07-01 23:55:52 +05:00
parent 3f17ee0da1
commit 7a78974053

View file

@ -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")