I have the following code where I try to set "build_info_match" to True only when all the build locations present in "engg_buildinfo" match with "prod_buildinfo",currently I believe I am hitting the error because prod_buildinfo is a string instead of dictionary,how do get the corresponding build location from prod_buildinfo?
CODE:-
prod_buildinfo = """|h6. {color:blue} Meta Build{color}|{color:blue}MSM1234.LA.1.9{color}|{color:blue}\\flower\location721\INTEGRATION\CI_MSM1234.LA.1.9-116391-STD.INT-2{color}|
|h6. {color:green}MSM1234{color}|
|h6. GLUE|GLUE.MSM1234.2.0|\\bigelow\zipbuild261\INTEGRATION\GLUE.MSM1234.2.0-00010.1-NOOP_TEST-1|
|h6. PASS|LA.HB.1.3.9|\\flower\location674\INTEGRATION\CI_LA.HB.1.3.9-19602-8x96.1-5|
|h6. MOD|MPSS.TH.2.0.2|\\flower\location678\INTEGRATION\MPSS.TH.2.0.2-00089-M1234FAAAANAAM-1|
|h6. BOOT|BOOT.XF.1.0|\\flower\location675\INTEGRATION\BOOT.XF.1.0-00297-M1234LAB-1|
|h6. TZ|TZ.BF.4.0.1|\\flower\location781\INTEGRATION\TZ.BF.4.0.1-00235-M1234AAAAANAAT-1|
|h6. ADSP|ADSP.1234.2.7.1|\\flower\location714\PROD\ADSP.1234.2.7.1-00121-00355-1|
|h6. SLPI|SLPI.HB.1.0|\\flower\location692\INTEGRATION\SLPI.HB.1.0-00277-M1234AAL-1|
|h6. RPM|RPM.BF.1.6|\\flower\location673\TEST\RPM.BF.1.6-00148-M1234AAAAANAAR-1|
|h6. WIR|WIR.RM.4.3|\\flower\location781\INTEGRATION\WIR.RM.4.3-00092-QCARMSWP-1|
|h6. BF|BF.RM.4.3|\\flower\location698\INTEGRATION\BF.RM.4.3-00022-QCABFSWP-1|
|h6. VIDEO|VIDEO.VE.4.2|\\flower\location682\PROD\VIDEO.VE.4.2-00018-PROD-1|
|h6. CPE_V2|CPE.TSF.2.0|\\flower\location670\INTEGRATION\CPE.TSF.2.0-00003-W9335AAAAAAAAQ-1|
|h6. GI|GI.SPR.1.0|\\nickle\zipbuild165\INTEGRATION\GI.SPR.1.0-10011-GISW-1|
|h6. UNKNOWN|WIR.ADDON_RM.3.0|\\nickle\zipbuild193\PROD\WIR.ADDON_RM.3.0-00013-CNSS_RMZ_WAPI-1|"""
engg_buildinfo = {'TZ':'\\gromit\location1\fw.861','PASS':'\\gromit\apps\pass.61'}
build_info_match = False
for key in engg_buildinfo :
engg_buildinfo['key'] = prod_buildinfo['key']
#all the build locations in dict match with buildinfo locations
build_info_match = True
print build_info_match
OUTPUT:-
Traceback (most recent call last):
File "buildinfo.py", line 27, in <module>
engg_buildinfo['key'] = prod_buildinfo['key']
TypeError: string indices must be integers, not str