Skip to content

Commit

Permalink
Fix bug when discern whether there are ssh and rsync
Browse files Browse the repository at this point in the history
`whereis notfound` output `notfound:` in linux
  • Loading branch information
brickgao committed Jul 11, 2015
1 parent 5e1fda5 commit 08f6d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion specchio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "0.1.0"
__version__ = "0.1.0-dev"
6 changes: 4 additions & 2 deletions specchio/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def main():
:return: None
"""
init_logger()
if os.popen("whereis ssh").read() == "":
_popen_str = os.popen("whereis ssh").read().strip()
if _popen_str == "" or _popen_str == "ssh:":
return logger.error("Specchio need `ssh`, "
"but there is no `ssh` in the system")
if os.popen("whereis rsync").read() == "":
_popen_str = os.popen("whereis rsync").read().strip()
if _popen_str == "" or _popen_str == "rsync:":
return logger.error("Specchio need `rsync`, "
"but there is no `rsync` in the system")
if len(sys.argv) >= 3:
Expand Down

0 comments on commit 08f6d42

Please sign in to comment.