PackeTsar/freeztp

Merge with local IDArray referencing external keystore fails

PackeTsar opened this issue · 0 comments

Running a merge-test against a real-ID contained in a locally configured IDArray, where the IDArray matches an externally-stored keystore, fails to match

Reproduction

ZTP Config

ztp set idarray STACK1 SERIAL1 SERIAL2 SERIAL3
#
ztp set external-keystore EXTERNAL type csv
ztp set external-keystore EXTERNAL file '/root/test.csv'

File:/root/test.csv

keystore_id,association,idarray_1,idarray_2,idarray_3,vl1_ip_address,hostname,vl1_netmask
SERIAL100,SHORT_TEMPLATE,,,,10.0.0.201,SOMEDEVICE,
STACK1,LONG_TEMPLATE,,,,10.0.0.200,CORESWITCH,255.255.255.0

File:/root/test.csv Equivalent Local Config

[root@ZTPSERVER ~]# ztp request external-keystore-test EXTERNAL                 
#
#
#
ztp set keystore SERIAL100 keystore_id SERIAL100
ztp set keystore SERIAL100 vl1_ip_address 10.0.0.201
ztp set keystore SERIAL100 hostname SOMEDEVICE
#
ztp set keystore STACK1 keystore_id STACK1
ztp set keystore STACK1 vl1_ip_address 10.0.0.200
ztp set keystore STACK1 hostname CORESWITCH
ztp set keystore STACK1 vl1_netmask 255.255.255.0
#
#
#
#
#
#
ztp set association id SERIAL100 template SHORT_TEMPLATE
ztp set association id STACK1 template LONG_TEMPLATE
#
#
#

Run the Merge-Test

[root@ZTPSERVER ~]# ztp request merge-test SERIAL1              
2020-06-17 16:19:33:   cfact.get_keystore_id: Checking Keystores and IDArrays for (SERIAL1)

2020-06-17 16:19:33:   cfact.get_keystore_id: Checking Keystore names for (SERIAL1)

2020-06-17 16:19:33:   cfact.get_keystore_id: ID (SERIAL1) not found in keystore names, checking local IDArrays

2020-06-17 16:19:33:   cfact.get_keystore_id: ID 'SERIAL1' resolved to arrayname 'STACK1'

2020-06-17 16:19:33:   cfact.get_keystore_id: A keystore matching arrayname 'STACK1' cannot be found. Discarding IDArray match

2020-06-17 16:19:33:   cfact.get_keystore_id: ID (SERIAL1) not found in local IDArrays, checking external Keystore names

2020-06-17 16:19:33:   cfact.get_keystore_id: ID (SERIAL1) not found in external Keystore names, checking external IDArrays

2020-06-17 16:19:33:   cfact.get_keystore_id: ID (SERIAL1) not found in external IDArrays. ID Lookup failed!

2020-06-17 16:19:33:   ID 'SERIAL1' cannot be found!

2020-06-17 16:19:33:   To check for usage of a default keystore use: ztp request default-keystore-test

[root@ZTPSERVER ~]#