Skip to content

Commit f425c25

Browse files
cmickeybprakashngit
authored andcommitted
change default key file name for identities
Signed-off-by: Mic Bowman <[email protected]>
1 parent 23ea39b commit f425c25

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

client/pdo/client/controller/contract_controller.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,36 @@ def __init__(self, initial_state, identity=None, private_key_file=None) :
6666
# --------------------------------------------------
6767
def set_identity(self, identity, private_key_file=None) :
6868
if private_key_file is None :
69-
private_key_file = self.get(['Key', 'FileName'], "{0}_private.pem".format(options.name))
69+
private_key_file = self.get(['Key', 'FileName'], "{0}_private.pem".format(identity))
7070

7171
self.identity = identity
7272
self.private_key_file = private_key_file
7373

7474
# --------------------------------------------------
7575
def set(self, keylist, value) :
76-
assert keylist
77-
7876
current = self.__data__
7977
for key in keylist[:-1] :
8078
if key not in current :
8179
current[key] = {}
80+
# this can break of current is a value not a dict
81+
# just let the exception happen & handle it elsewhere
8282
current = current[key]
8383

8484
current[keylist[-1]] = value
85+
return value
8586

8687
# --------------------------------------------------
8788
def get(self, keylist, value=None) :
88-
assert keylist
89-
9089
current = self.__data__
9190
for key in keylist :
9291
if key not in current :
9392
return value
93+
# this can break of current is a value not a dict
94+
# just let the exception happen & handle it elsewhere
9495
current = current[key]
9596
return current
9697

98+
9799
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
98100
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
99101
class Bindings(object) :

0 commit comments

Comments
 (0)