Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行 prophet-cli collect --host-file /tmp/scan_hosts.csv --output-path /tmp的时候报错 #9

Open
qingyunliu opened this issue Jan 14, 2022 · 1 comment

Comments

@qingyunliu
Copy link

当scan_hosts.csv这个文件里没有机器,或者scan_hosts.csv有机器但是没有调用ansible去进行收集信息的时候,就会报错。报错的原因是:必须ansible收集到信息,才会开始去创建hosts_collection这个目录。一旦hosts_collection这个目录不能成功创建,就会出现报错。

报错信息如下:
2022-01-14 11:10:55,360 20668 INFO [-] Need to check 0 host(s), success 0 hosts, failed 0 hosts.
2022-01-14 11:10:55,360 20668 INFO [-] ============================
2022-01-14 11:10:55,360 20668 INFO [-] Copying log file into collection info path...
2022-01-14 11:10:55,360 20668 INFO [-] Copying /tmp/prophet.log to /tmp/hosts_collection...
2022-01-14 11:10:55,361 20668 INFO [-] Compressed pacakge in /tmp/, filename is hosts_collection_20220114111055.zip...
Traceback (most recent call last):
File "/root/prophet/venv/bin/prophet-cli", line 8, in
sys.exit(main())
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/cmd/cli.py", line 147, in main
args.func(args)
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/cmd/cli.py", line 62, in collect_hosts
host_collector.package()
File "/root/prophet/venv/lib/python3.6/site-packages/prophet/collector/collector.py", line 196, in package
self.collection_path)
File "/usr/lib64/python3.6/shutil.py", line 785, in make_archive
os.chdir(root_dir)
NotADirectoryError: [Errno 20] Not a directory: '/tmp/hosts_collection'

@oneprocloud
Copy link
Contributor

Create output path by default, this is already fixed, please double check with latest code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants