-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #866 from dbcli/paramiko-compatibility
Changed paramiko usage to work with older versions
- Loading branch information
Showing
4 changed files
with
60 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""A module to import instead of paramiko when it is not available (to avoid | ||
checking for paramiko all over the place). | ||
When paramiko is first envoked, it simply shuts down mycli, telling | ||
user they either have to install paramiko or should not use SSH | ||
features. | ||
""" | ||
|
||
|
||
class Paramiko: | ||
def __getattr__(self, name): | ||
import sys | ||
from textwrap import dedent | ||
print(dedent(""" | ||
To enable certain SSH features you need to install paramiko: | ||
pip install paramiko | ||
It is required for the following configuration options: | ||
--list-ssh-config | ||
--ssh-config-host | ||
--ssh-host | ||
""")) | ||
sys.exit(1) | ||
|
||
|
||
paramiko = Paramiko() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters