Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
paramiko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
paramiko
Commits
7efc52686519
Commit
7efc52686519
authored
11 years ago
by
Jeff Forcier
Browse files
Options
Downloads
Plain Diff
Merge branch '1.11' into 1.12
Conflicts: NEWS
parents
58919bf9fd3f
a5b112befe92
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS
+21
-0
21 additions, 0 deletions
NEWS
paramiko/client.py
+2
-2
2 additions, 2 deletions
paramiko/client.py
tests/test_client.py
+30
-1
30 additions, 1 deletion
tests/test_client.py
with
53 additions
and
3 deletions
NEWS
+
21
−
0
View file @
7efc5268
...
...
@@ -12,6 +12,27 @@
Releases
========
v1.12.1 (8th Jan 2014)
----------------------
* #176: Fix AttributeError bugs in known_hosts file (re)loading. Thanks to
Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test
case.
v1.11.3 (8th Jan 2014)
----------------------
* #176: Fix AttributeError bugs in known_hosts file (re)loading. Thanks to
Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test
case.
v1.10.5 (8th Jan 2014)
----------------------
* #176: Fix AttributeError bugs in known_hosts file (re)loading. Thanks to
Nathan Scowcroft for the patch & Martin Blumenstingl for the initial test
case.
v1.12.0 (27th Sep 2013)
-----------------------
...
...
This diff is collapsed.
Click to expand it.
paramiko/client.py
+
2
−
2
View file @
7efc5268
...
...
@@ -189,8 +189,8 @@
# update local host keys from file (in case other SSH clients
# have written to the known_hosts file meanwhile.
if
self
.
known_hosts
is
not
None
:
self
.
load_host_keys
(
self
.
known_hosts
)
if
self
.
_host_keys_filename
is
not
None
:
self
.
load_host_keys
(
self
.
_host_keys_filename
)
f
=
open
(
filename
,
'
w
'
)
for
hostname
,
keys
in
self
.
_host_keys
.
iteritems
():
...
...
This diff is collapsed.
Click to expand it.
tests/test_client.py
+
30
−
1
View file @
7efc5268
...
...
@@ -20,8 +20,9 @@
Some unit tests for SSHClient.
"""
from
__future__
import
with_statement
# Python 2.5 support
import
socket
import
threading
import
time
import
unittest
import
weakref
...
...
@@ -23,8 +24,10 @@
import
socket
import
threading
import
time
import
unittest
import
weakref
import
warnings
import
os
from
binascii
import
hexlify
import
paramiko
...
...
@@ -184,7 +187,33 @@
self
.
assertEquals
(
1
,
len
(
self
.
tc
.
get_host_keys
()))
self
.
assertEquals
(
public_host_key
,
self
.
tc
.
get_host_keys
()[
'
[%s]:%d
'
%
(
self
.
addr
,
self
.
port
)][
'
ssh-rsa
'
])
def
test_5_cleanup
(
self
):
def
test_5_save_host_keys
(
self
):
"""
verify that SSHClient correctly saves a known_hosts file.
"""
warnings
.
filterwarnings
(
'
ignore
'
,
'
tempnam.*
'
)
host_key
=
paramiko
.
RSAKey
.
from_private_key_file
(
'
tests/test_rsa.key
'
)
public_host_key
=
paramiko
.
RSAKey
(
data
=
str
(
host_key
))
localname
=
os
.
tempnam
()
client
=
paramiko
.
SSHClient
()
self
.
assertEquals
(
0
,
len
(
client
.
get_host_keys
()))
host_id
=
'
[%s]:%d
'
%
(
self
.
addr
,
self
.
port
)
client
.
get_host_keys
().
add
(
host_id
,
'
ssh-rsa
'
,
public_host_key
)
self
.
assertEquals
(
1
,
len
(
client
.
get_host_keys
()))
self
.
assertEquals
(
public_host_key
,
client
.
get_host_keys
()[
host_id
][
'
ssh-rsa
'
])
client
.
save_host_keys
(
localname
)
with
open
(
localname
)
as
fd
:
assert
host_id
in
fd
.
read
()
os
.
unlink
(
localname
)
def
test_6_cleanup
(
self
):
"""
verify that when an SSHClient is collected, its transport (and the
transport
'
s packetizer) is closed.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment