File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def get_path():
3939 if os .path .exists (path ):
4040 return path
4141
42- def resolve_loaction (value ):
42+ def resolve_location (value ):
4343 nonlocal path
4444 sp = value .split (':' )
4545 if len (sp ) == 1 :
@@ -48,7 +48,7 @@ def resolve_loaction(value):
4848 else :
4949 schema , loc = sp
5050 if not loc or not os .path .exists (loc ):
51- if loc :
51+ if loc and ( path is not None ) :
5252 loc = os .path .join (os .path .dirname (path ), loc )
5353 if not loc or not os .path .exists (loc ):
5454 loc = '~/.ndn/ndnsec-key-file' if schema == 'tpm-file' else '~/.ndn'
@@ -67,13 +67,18 @@ def resolve_loaction(value):
6767 with open (path ) as f :
6868 text += f .read ()
6969 parser .read_string (text )
70- for key in [ 'transport' , 'pib' , 'tpm' ] :
70+ for key in ret . keys () :
7171 try :
7272 ret [key ] = parser ['DEFAULT' ][key ]
7373 except KeyError :
7474 pass
75+ for key in ret .keys ():
76+ try :
77+ ret [key ] = os .environ [f'NDN_CLIENT_{ key .upper ()} ' ]
78+ except KeyError :
79+ pass
7580 for key in ['pib' , 'tpm' ]:
76- ret [key ] = resolve_loaction (ret [key ])
81+ ret [key ] = resolve_location (ret [key ])
7782 return ret
7883
7984
You can’t perform that action at this time.
0 commit comments