[niedbalski] fixup unit tests for key management
This commit is contained in:
commit
0f4aefaeb3
@ -627,7 +627,10 @@ def ssh_compute_remove(public_key, user=None):
|
||||
[keys.remove(key) for key in keys if key == public_key]
|
||||
|
||||
with open(authorized_keys(user), 'w') as _keys:
|
||||
_keys.write('\n'.join(keys) + '\n')
|
||||
keys = '\n'.join(keys)
|
||||
if not keys.endswith('\n'):
|
||||
keys += '\n'
|
||||
_keys.write(keys)
|
||||
|
||||
|
||||
def determine_endpoints(url):
|
||||
|
@ -405,7 +405,7 @@ class NovaCCUtilsTests(CharmTestCase):
|
||||
"\nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC27Us7lSjCpa7bumXAgc "
|
||||
"nova-compute-1\n"
|
||||
"ssh-rsa CCCCB3NzaC1yc2ECCCCDCQCBCCCBCQC27Us7lSjCpa7bumXCgc "
|
||||
"nova-compute-3\n\n"
|
||||
"nova-compute-3\n"
|
||||
)
|
||||
isfile.return_value = True
|
||||
self.remote_unit.return_value = 'nova-compute/2'
|
||||
|
Loading…
Reference in New Issue
Block a user