monkeysphere: Fix handling of multiple domains and keys

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-02-09 12:27:57 -05:00
1 parent 722fa39c2a
commit 49640fdfce
2 files changed
+6 -6

No files matched your search

+3 -4
View File
@@ -50,13 +50,12 @@ def index(request):
@require_POST
def import_key(request, ssh_fingerprint):
"""Import a key into monkeysphere."""
available_domains = [
domain for domains in names.domains.values() for domain in domains
]
keys = get_keys()
available_domains = keys[ssh_fingerprint]['available_domains']
try:
actions.superuser_run(
'monkeysphere',
['host-import-key', ssh_fingerprint] + available_domains)
['host-import-key', ssh_fingerprint] + list(available_domains))
messages.success(request, _('Imported key.'))
except actions.ActionError as exception:
messages.error(request, str(exception))