writeAuthorizedKeys now reads old file by name, not by open file.
This commit is contained in:
parent
8d69bf23fa
commit
085e5fffa7
1 changed files with 6 additions and 2 deletions
|
@ -171,7 +171,9 @@ class WriteAuthorizedKeys_Test(object):
|
|||
def test_simple(self):
|
||||
tmp = maketemp()
|
||||
path = os.path.join(tmp, 'authorized_keys')
|
||||
oldfp = StringIO('''\
|
||||
f = file(path, 'w')
|
||||
try:
|
||||
f.write('''\
|
||||
# foo
|
||||
bar
|
||||
### autogenerated by gitosis, DO NOT EDIT
|
||||
|
@ -179,12 +181,14 @@ command="/foo/bar/baz/gitosis-serve wsmith",no-port-forwarding,\
|
|||
no-X11-forwarding,no-agent-forwarding,no-pty %(key_2)s
|
||||
baz
|
||||
''' % dict(key_2=KEY_2))
|
||||
finally:
|
||||
f.close()
|
||||
keydir = os.path.join(tmp, 'one')
|
||||
mkdir(keydir)
|
||||
writeFile(os.path.join(keydir, 'jdoe.pub'), KEY_1+'\n')
|
||||
|
||||
ssh.writeAuthorizedKeys(
|
||||
oldfp=oldfp, newpath=path, keydir=keydir)
|
||||
path=path, keydir=keydir)
|
||||
|
||||
f = file(path)
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue