Skip to content

Commit

Permalink
#68 Fixed bad merging and merge-tests when IDarray is local and keyst…
Browse files Browse the repository at this point in the history
…ore is external
  • Loading branch information
PackeTsar committed Jun 18, 2020
1 parent 79bcdca commit 2e0d5ca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ztp.py
Expand Up @@ -7,7 +7,7 @@
##### https://github.com/packetsar/freeztp #####

##### Inform FreeZTP version here #####
version = "v1.4.0"
version = "v1.4.0a"


##### Import native modules #####
Expand Down Expand Up @@ -580,11 +580,14 @@ def get_keystore_id(self, idens, silent=False):
if identifier in config.running["idarrays"][arrayname]:
if not silent:
log("cfact.get_keystore_id: ID '%s' resolved to arrayname '%s'" % (identifier, arrayname))
if arrayname in list(config.running["keyvalstore"]):
log("cfact.get_keystore_id: Keystore with name '%s' has been found" % arrayname)
return (arrayname, identifier)
else:
log("cfact.get_keystore_id: A keystore matching arrayname '%s' cannot be found. Discarding IDArray match" % arrayname)
if arrayname in list(config.running["keyvalstore"]):
log("cfact.get_keystore_id: Keystore with name '%s' has been found" % arrayname)
return (arrayname, identifier)
elif arrayname in list(external_keystores.data["keyvalstore"]):
log("cfact.get_keystore_id: Keystore with name '%s' has been found in an external-keystore" % arrayname)
return (arrayname, identifier)
else:
log("cfact.get_keystore_id: A keystore matching arrayname '%s' cannot be found. Discarding IDArray match" % arrayname)
if not silent:
log("cfact.get_keystore_id: ID (%s) not found in local IDArrays, checking external Keystore names" % identifier)
if identifier in list(external_keystores.data["keyvalstore"]):
Expand Down

0 comments on commit 2e0d5ca

Please sign in to comment.