client: set identity index explicitly

This commit is contained in:
Roman Zeyde 2016-02-06 17:50:23 +02:00
parent cafa218e19
commit 2f2663ef94
2 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,7 @@ def test_ssh_agent():
assert ident.port == '22' assert ident.port == '22'
assert ident.user is None assert ident.user is None
assert ident.path is None assert ident.path is None
assert ident.index == 0
with c: with c:
assert c.get_public_key(label) == PUBKEY_TEXT assert c.get_public_key(label) == PUBKEY_TEXT

View File

@ -18,6 +18,7 @@ class Client(object):
self.identity_type = client_wrapper.identity_type self.identity_type = client_wrapper.identity_type
self.device_name = client_wrapper.device_name self.device_name = client_wrapper.device_name
self.curve = curve self.curve = curve
self.identity_index = 0
def __enter__(self): def __enter__(self):
msg = 'Hello World!' msg = 'Hello World!'
@ -32,6 +33,7 @@ class Client(object):
def get_identity(self, label): def get_identity(self, label):
identity = string_to_identity(label, self.identity_type) identity = string_to_identity(label, self.identity_type)
identity.proto = 'ssh' identity.proto = 'ssh'
identity.index = self.identity_index
return identity return identity
def get_public_key(self, label): def get_public_key(self, label):