Commit 7a1e3ed7 authored by Xavier Thompson's avatar Xavier Thompson

Use current directory as starting path instead of '/'

parent f61f42ca
......@@ -252,6 +252,7 @@ cdef int start(string path) nogil:
ignore_paths.append(b'/srv/slapgrid')
dev_whitelist_paths = cyplist[string]()
dev_whitelist_paths.append(b'.')
dev_whitelist_paths.append(b'/')
dev_whitelist_paths.append(b'/boot')
......@@ -285,7 +286,7 @@ cdef int start(string path) nogil:
return 0
cdef public int main() nogil:
return start(<char*>'/')
return start(<char*>'.')
def python_main():
start(<char*>'/')
start(<char*>'.')
......@@ -131,14 +131,14 @@ def main():
ignored_dirs = ["/opt/slapgrid", "/srv/slapgrid"]
dev_whitelist = list()
for path in ["/", "/boot"]:
for path in [".", "/", "/boot"]:
try:
dev_whitelist.append(
os.stat(path, follow_symlinks=False).st_dev)
except FileNotFoundError:
pass
tree = construct_fs_tree(path="/", dev_whitelist=dev_whitelist, ignored_dirs=ignored_dirs)
tree = construct_fs_tree(path=".", dev_whitelist=dev_whitelist, ignored_dirs=ignored_dirs)
with open('result.json', 'w') as fp:
json.dump(tree, fp, indent=2, separators=(',', ': '))
......
......@@ -194,7 +194,7 @@ fn main() -> Result<()> {
.map(PathBuf::from)
.collect();
let disk_partitions = ["/", "/boot"];
let disk_partitions = [".", "/", "/boot"];
let dev_whitelist = disk_partitions
.iter()
......@@ -206,7 +206,7 @@ fn main() -> Result<()> {
let tree = construct_fs_tree(
None,
&PathBuf::from("/"),
&PathBuf::from("."),
&dev_whitelist,
&ignored_dirs,
)?;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment