owner + file_path fixed
This commit is contained in:
parent
3f17ee0da1
commit
7a78974053
1 changed files with 2 additions and 4 deletions
6
main.py
6
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")
|
||||
|
|
Loading…
Reference in a new issue