diff --git a/setup.py b/setup.py index 7c4fa0a..67d61ff 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ 'paramiko>=1.16.0', 'pathlib2>=2.1.0', 'blinker>=1.4', - 'google-measurement-protocol>=0.1.6', + 'google-measurement-protocol==0.1.6', ] # pylint: disable=invalid-name diff --git a/termius/core/commands/mixins.py b/termius/core/commands/mixins.py index cd0fdb7..32efd49 100644 --- a/termius/core/commands/mixins.py +++ b/termius/core/commands/mixins.py @@ -280,7 +280,7 @@ def get_visible_identity(self, ssh_config_merger): """Return first of visible identity.""" stack = [ i.identity for i in ssh_config_merger.get_entry_stack() - if i.identity.get('is_visible') + if i.identity and i.identity.get('is_visible') ] return (stack and stack[0]) or None @@ -289,6 +289,6 @@ def get_identity_merger(self, ssh_config_merger): """Create identity merger for passed merger.""" stack = [ i for i in ssh_config_merger.get_entry_stack() - if not i.identity.get('is_visible') + if i.identity and not i.identity.get('is_visible') ] return Merger(stack, 'identity', Identity()) diff --git a/termius/porting/providers/ssh/adapter.py b/termius/porting/providers/ssh/adapter.py index 55d6fe4..0416d52 100644 --- a/termius/porting/providers/ssh/adapter.py +++ b/termius/porting/providers/ssh/adapter.py @@ -15,7 +15,7 @@ class SSHConfigHostAdapter(SshConfigMergerMixin): def get_instance_ssh_key_label(self, ssh_config): """Helper to retrieve ssh_key lable.""" - if ssh_config['identity'] and ssh_config['identity']['ssh_key']: + if ssh_config['identity'] and ssh_config['identity'].get('ssh_key'): return ssh_config['identity']['ssh_key']['label'] return None @@ -43,7 +43,7 @@ def adapt_instance_to_ssh_config_host(self, host_instance): adapted = { 'hostname': host_instance['address'], - 'user': ssh_config['identity']['username'], + 'user': ssh_config['identity'].get('username'), 'port': ssh_config['port'] or 22 }