-def verify_ran_is_associated_with_e2t_instance(ranName, e2tAddress):
- r = getRedisClientDecodeResponse()
- e2tInstanceJson = r.get("{e2Manager},E2TInstance:"+e2tAddress)
- e2tInstanceDic = json.loads(e2tInstanceJson)
- assocRanList = e2tInstanceDic.get("associatedRanList")
- return ranName in assocRanList
-
-def verify_e2t_instance_has_no_associated_rans(e2tAddress):
- r = getRedisClientDecodeResponse()
- e2tInstanceJson = r.get("{e2Manager},E2TInstance:"+e2tAddress)
- e2tInstanceDic = json.loads(e2tInstanceJson)
- assocRanList = e2tInstanceDic.get("associatedRanList")
- return not assocRanList
-
-def verify_e2t_instance_exists_in_addresses(e2tAddress):
- r = getRedisClientDecodeResponse()
- e2tAddressesJson = r.get("{e2Manager},E2TAddresses")
- e2tAddresses = json.loads(e2tAddressesJson)
- return e2tAddress in e2tAddresses
-
-def verify_e2t_instance_key_exists(e2tAddress):
- r = getRedisClientDecodeResponse()
- return r.exists("{e2Manager},E2TInstance:"+e2tAddress)
+
+def verify_ran_is_associated_with_e2t_instance(ran_name, e2t_address):
+ r = get_redis_client_decode_response()
+ e2t_instance_json = r.get("{e2Manager},E2TInstance:" + e2t_address)
+
+ if e2t_instance_json is None:
+ return False
+
+ e2t_instance_dic = json.loads(e2t_instance_json)
+ assoc_ran_list = e2t_instance_dic.get("associatedRanList")
+ if assoc_ran_list is None:
+ return False
+ else:
+ return ran_name in assoc_ran_list
+
+
+def verify_e2t_instance_has_no_associated_rans(e2t_address):
+ r = get_redis_client_decode_response()
+ e2t_instance_json = r.get("{e2Manager},E2TInstance:" + e2t_address)
+ e2t_instance_dic = json.loads(e2t_instance_json)
+ assoc_ran_list = e2t_instance_dic.get("associatedRanList")
+ return not assoc_ran_list
+
+
+def verify_e2t_instance_exists_in_addresses(e2t_address):
+ r = get_redis_client_decode_response()
+ e2t_addresses_json = r.get("{e2Manager},E2TAddresses")
+ e2t_addresses = json.loads(e2t_addresses_json)
+ return e2t_address in e2t_addresses
+
+
+def verify_e2t_instance_key_exists(e2t_address):
+ r = get_redis_client_decode_response()
+ return r.exists("{e2Manager},E2TInstance:" + e2t_address)
+