X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Fsrc%2Fcommon%2Futils.py;h=f0df44805a2f2d3053cc1e06e3a1713549db6ebe;hb=24ee2701e54884c8fc2ed7e6cf522d71286a3b33;hp=1ed2a7ed88c5a37d6531637e40cb0e48e32ad3d9;hpb=59e2b2abfe0474acacb44a2922bfaf01b26bfa06;p=sim%2Fa1-interface.git diff --git a/near-rt-ric-simulator/src/common/utils.py b/near-rt-ric-simulator/src/common/utils.py index 1ed2a7e..f0df448 100644 --- a/near-rt-ric-simulator/src/common/utils.py +++ b/near-rt-ric-simulator/src/common/utils.py @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# Copyright (C) 2021 Nordix Foundation. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,12 +15,15 @@ # ============LICENSE_END================================================= # -#Calculate a fingerprint from sorted items of a dict -def calcFingerprint(p): +#Calculate a fingerprint from sorted items of a dict, appending an optional id +def calcFingerprint(p, pid=None): m='' + ext='' + if (pid is not None): + ext=pid if (p is dict): for i in sorted (p.keys()): m = m+str(i)+calcFingerprint(p[i]) else: - return str(p) - return m \ No newline at end of file + return str(p)+ext + return m+ext \ No newline at end of file