git://git.onelab.eu
/
tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb4a3d4
)
Properly handle the case when keys exists and the new key does not handle the user...
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Fri, 8 Feb 2008 19:02:10 +0000
(19:02 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Fri, 8 Feb 2008 19:02:10 +0000
(19:02 +0000)
qaapi/qa/tests/sync_person_key.py
patch
|
blob
|
history
diff --git
a/qaapi/qa/tests/sync_person_key.py
b/qaapi/qa/tests/sync_person_key.py
index
d836964
..
2276bb8
100755
(executable)
--- a/
qaapi/qa/tests/sync_person_key.py
+++ b/
qaapi/qa/tests/sync_person_key.py
@@
-46,11
+46,10
@@
class sync_person_key(Test):
public_key_file = open(public_key_path, 'r')
public_key = public_key_file.readline()
public_key_file = open(public_key_path, 'r')
public_key = public_key_file.readline()
+ key_fields = {'key_type': 'ssh', 'key': public_key}
keys = api.GetKeys(auth, person['key_ids'])
if not keys:
# Add current key to db
keys = api.GetKeys(auth, person['key_ids'])
if not keys:
# Add current key to db
- key_fields = {'key_type': 'ssh',
- 'key': public_key}
api.AddPersonKey(auth, person['person_id'], key_fields)
if self.config.verbose:
utils.header("Added public key in %(public_key_path)s to db" % locals() )
api.AddPersonKey(auth, person['person_id'], key_fields)
if self.config.verbose:
utils.header("Added public key in %(public_key_path)s to db" % locals() )
@@
-58,7
+57,7
@@
class sync_person_key(Test):
# keys need to be checked and possibly updated
key = keys[0]
if key['key'] != public_key:
# keys need to be checked and possibly updated
key = keys[0]
if key['key'] != public_key:
- api.UpdateKey(auth, key['key_id'],
public_key
)
+ api.UpdateKey(auth, key['key_id'],
key_fields
)
if self.config.verbose:
utils.header("Updated plc with new public key in %(public_key_path)s " % locals())
else:
if self.config.verbose:
utils.header("Updated plc with new public key in %(public_key_path)s " % locals())
else: