@@ -1008,7 +1008,7 @@ def getPathBy(self,rft, r, coll, prop=None):
1008
1008
1009
1009
elif (rft .gotMatchOptn ):
1010
1010
baseUrl = r .url
1011
- matchedPath = None
1011
+ matchedPath , matchedRc , matchedR , matchedJ , matchedD = None , 1 , None , False , None
1012
1012
matches = 0
1013
1013
for i in range (0 ,numOfLinks ):
1014
1014
if ( '@odata.id' not in coll ['Members' ][i ] ):
@@ -1019,13 +1019,13 @@ def getPathBy(self,rft, r, coll, prop=None):
1019
1019
rc ,r ,j ,d = rft .rftSendRecvRequest (rft .AUTHENTICATED_API , 'GET' , baseUrl , relPath = path )
1020
1020
if (rc == 0 ): # if matchProp found
1021
1021
if ( d [rft .matchProp ] == rft .matchValue ):
1022
- matchedPath = path
1022
+ matchedPath , matchedRc , matchedR , matchedJ , matchedD = path , rc , r , j , d
1023
1023
matches += 1
1024
1024
if ( matches > 1 ):
1025
1025
rft .printErr ("Error: getPathBy --Id or --Match option: failed: found multiple matches." )
1026
1026
return (None ,1 ,None ,False ,None )
1027
1027
if (rft .firstOptn ):
1028
- return (matchedPath ,rc , r , j , d )
1028
+ return (matchedPath ,matchedRc , matchedR , matchedJ , matchedD )
1029
1029
else :
1030
1030
rft .printVerbose (4 ,"Transport:getPathBy:Match: failed match: matchProp={}, matchValue={}, readValue={}" .format (rft .matchProp ,rft .matchValue ,d [rft .matchProp ]))
1031
1031
pass
@@ -1035,7 +1035,7 @@ def getPathBy(self,rft, r, coll, prop=None):
1035
1035
#after looping over all members in the array,
1036
1036
#if here, if we got a match, return the path. If not, then no match was found. return none
1037
1037
if ( matches > 0 ):
1038
- return (matchedPath ,rc , r , j , d )
1038
+ return (matchedPath ,matchedRc , matchedR , matchedJ , matchedD )
1039
1039
else :
1040
1040
rft .printErr ("Error: getPathBy --Id or --Match option: no match found in collection" )
1041
1041
return (None ,1 ,None ,False ,None )
0 commit comments