mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #7406 from specnazzz/fix-python24
Fix known_hosts.py to work on older versions of python
This commit is contained in:
commit
3b8a35d65e
1 changed files with 6 additions and 1 deletions
|
@ -27,7 +27,12 @@
|
||||||
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
import hmac
|
import hmac
|
||||||
from hashlib import sha1
|
|
||||||
|
try:
|
||||||
|
from hashlib import sha1
|
||||||
|
except ImportError:
|
||||||
|
import sha as sha1
|
||||||
|
|
||||||
HASHED_KEY_MAGIC = "|1|"
|
HASHED_KEY_MAGIC = "|1|"
|
||||||
|
|
||||||
def add_git_host_key(module, url, accept_hostkey=True, create_dir=True):
|
def add_git_host_key(module, url, accept_hostkey=True, create_dir=True):
|
||||||
|
|
Loading…
Reference in a new issue