Repository: ChannelFinder/recsync
Pull request #104: Rename shorter variables to longer more descriptive ones
Author: login: jacomago
Created: 2025-03-10T14:16:26Z | Merged: 2025-03-13T10:23:00Z



Diff:
diff --git a/server/recceiver/announce.py b/server/recceiver/announce.py
index 45c214fd..9c1d3f25 100644
--- a/server/recceiver/announce.py
+++ b/server/recceiver/announce.py
@@ -52,7 +52,7 @@ def stopProtocol(self):
         self.D.cancel()
         del self.D
 
-    def datagramReceived(self, src):
+    def datagramReceived(self, source_address):
         pass  # ignore
 
     def sendOne(self):
diff --git a/server/recceiver/cfstore.py b/server/recceiver/cfstore.py
index e0a41307..ce23e6f2 100755
--- a/server/recceiver/cfstore.py
+++ b/server/recceiver/cfstore.py
@@ -24,11 +24,11 @@
 
 # ITRANSACTION FORMAT:
 #
-# src = source address
-# addrec = records ein added ( recname, rectype, {key:val})
-# delrec = a set() of records which are being removed
-# infos = dictionary of client infos
-# recinfos = additional infos being added to existing records
+# source_address = source address
+# records_to_add = records ein added ( recname, rectype, {key:val})
+# records_to_delete = a set() of records which are being removed
+# client_infos = dictionary of client client_infos
+# record_infos_to_add = additional client_infos being added to existing records
 # "recid: {key:value}"
 #
 
@@ -77,8 +77,8 @@ def _startServiceWithLock(self):
             """
             self.client = ChannelFinderClient()
             try:
-                cf_props = [prop["name"] for prop in self.client.getAllProperties()]
-                reqd_props = {
+                cf_properties = [cf_property["name"] for cf_property in self.client.getAllProperties()]
+                required_properties = {
                     "hostName",
                     "iocName",
                     "pvStatus",
@@ -89,42 +89,42 @@ def _startServiceWithLock(self):
                 }
 
                 if self.conf.get("alias"):
-                    reqd_props.add("alias")
+                    required_properties.add("alias")
                 if self.conf.get("recordType"):
-                    reqd_props.add("recordType")
+                    required_properties.add("recordType")
                 env_vars_setting = self.conf.get("environment_vars")
                 self.env_vars = {}
                 if env_vars_setting != "" and env_vars_setting is not None:
                     env_vars_dict = dict(item.strip().split(":") for item in env_vars_setting.split(","))
                     self.env_vars = {k.strip(): v.strip() for k, v in env_vars_dict.items()}
                     for epics_env_var_name, cf_prop_name in self.env_vars.items():
-                        reqd_props.add(cf_prop_name)
+                        required_properties.add(cf_prop_name)
                 # Standard property names for CA/PVA name server connections. These are
                 # environment variables from reccaster so take advantage of env_vars
                 if self.conf.get("iocConnectionInfo"):
                     self.env_vars["RSRV_SERVER_PORT"] = "caPort"
                     self.env_vars["PVAS_SERVER_PORT"] = "pvaPort"
-                    reqd_props.add("caPort")
-                    reqd_props.add("pvaPort")
-                wl = self.conf.get("infotags", list())
-                if wl:
-                    whitelist = [s.strip(", ") for s in wl.split()]
+                    required_properties.add("caPort")
+                    required_properties.add("pvaPort")
+                infotags_whitelist = self.conf.get("infotags", list())
+                if infotags_whitelist:
+                    record_property_names_list = [s.strip(", ") for s in infotags_whitelist.split()]
                 else:
-                    whitelist = []
+                    record_property_names_list = []
                 if self.conf.get("recordDesc"):
-                    whitelist.append("recordDesc")
+                    record_property_names_list.append("recordDesc")
                 # Are any required properties not already present on CF?
-                properties = reqd_props - set(cf_props)
+                properties = required_properties - set(cf_properties)
                 # Are any whitelisted properties not already present on CF?
                 # If so, add them too.
-                properties.update(set(whitelist) - set(cf_props))
+                properties.update(set(record_property_names_list) - set(cf_properties))
 
                 owner = self.conf.get("username", "cfstore")
-                for prop in properties:
-                    self.client.set(property={"name": prop, "owner": owner})
+                for cf_property in properties:
+                    self.client.set(property={"name": cf_property, "owner": owner})
 
-                self.whitelist = set(whitelist)
-                _log.debug("WHITELIST = {}".format(self.whitelist))
+                self.record_property_names_list = set(record_property_names_list)
+                _log.debug("record_property_names_list = {}".format(self.record_property_names_list))
             except ConnectionError:
                 _log.exception("Cannot connect to Channelfinder service")
                 raise
@@ -147,10 +147,10 @@ def _stopServiceWithLock(self):
     def commit(self, transaction_record):
         return self.lock.run(self._commitWithLock, transaction_record)
 
-    def _commitWithLock(self, TR):
+    def _commitWithLock(self, transaction):
         self.cancelled = False
 
-        t = deferToThread(self._commitWithThread, TR)
+        t = deferToThread(self._commitWithThread, transaction)
 
         def cancelCommit(d):
             self.cancelled = True
@@ -183,70 +183,82 @@ def chainResult(_ignored):
         t.addCallbacks(chainResult, chainError)
         return d
 
-    def _commitWithThread(self, TR):
+    def _commitWithThread(self, transaction):
         if not self.running:
             raise defer.CancelledError(
-                "CF Processor is not running (TR: {host}:{port})",
-                host=TR.src.host,
-                port=TR.src.port,
+                "CF Processor is not running (transaction: {host}:{port})",
+                host=transaction.source_address.host,
+                port=transaction.source_address.port,
             )
 
-        _log.info("CF_COMMIT: {TR}".format(TR=TR))
+        _log.info("CF_COMMIT: {transaction}".format(transaction=transaction))
         """
         a dictionary with a list of records with their associated property info
         pvInfo
-        {rid: { "pvName":"recordName",
+        {record_id: { "pvName":"recordName",
                 "infoProperties":{propName:value, ...}}}
         """
 
-        host = TR.src.host
-        port = TR.src.port
-        iocName = TR.infos.get("IOCNAME") or TR.src.port
-        hostName = TR.infos.get("HOSTNAME") or TR.src.host
-        owner = TR.infos.get("ENGINEER") or TR.infos.get("CF_USERNAME") or self.conf.get("username", "cfstore")
+        host = transaction.source_address.host
+        port = transaction.source_address.port
+        iocName = transaction.client_infos.get("IOCNAME") or transaction.source_address.port
+        hostName = transaction.client_infos.get("HOSTNAME") or transaction.source_address.host
+        owner = (
+            transaction.client_infos.get("ENGINEER")
+            or transaction.client_infos.get("CF_USERNAME")
+            or self.conf.get("username", "cfstore")
+        )
         time = self.currentTime(timezone=self.conf.get("timezone"))
 
         """The unique identifier for a particular IOC"""
         iocid = host + ":" + str(port)
 
-        pvInfo = {}
-        for rid, (rname, rtype) in TR.addrec.items():
-            pvInfo[rid] = {"pvName": rname}
+        recordInfo = {}
+        for record_id, (record_name, record_type) in transaction.records_to_add.items():
+            recordInfo[record_id] = {"pvName": record_name}
             if self.conf.get("recordType"):
-                pvInfo[rid]["recordType"] = rtype
-        for rid, (recinfos) in TR.recinfos.items():
+                recordInfo[record_id]["recordType"] = record_type
+        for record_id, (record_infos_to_add) in transaction.record_infos_to_add.items():
             # find intersection of these sets
-            if rid not in pvInfo:
-                _log.warning("IOC: {iocid}: PV not found for recinfo with RID: {rid}".format(iocid=iocid, rid=rid))
+            if record_id not in recordInfo:
+                _log.warning(
+                    "IOC: {iocid}: PV not found for recinfo with RID: {record_id}".format(
+                        iocid=iocid, record_id=record_id
+                    )
+                )
                 continue
-            recinfo_wl = [p for p in self.whitelist if p in recinfos.keys()]
+            recinfo_wl = [p for p in self.record_property_names_list if p in record_infos_to_add.keys()]
             if recinfo_wl:
-                pvInfo[rid]["infoProperties"] = list()
+                recordInfo[record_id]["infoProperties"] = list()
                 for infotag in recinfo_wl:
                     property = {
                         "name": infotag,
                         "owner": owner,
-                        "value": recinfos[infotag],
+                        "value": record_infos_to_add[infotag],
                     }
-                    pvInfo[rid]["infoProperties"].append(property)
+                    recordInfo[record_id]["infoProperties"].append(property)
 
-        for rid, alias in TR.aliases.items():
-            if rid not in pvInfo:
-                _log.warning("IOC: {iocid}: PV not found for alias with RID: {rid}".format(iocid=iocid, rid=rid))
+        for record_id, alias in transaction.aliases.items():
+            if record_id not in recordInfo:
+                _log.warning(
+                    "IOC: {iocid}: PV not found for alias with RID: {record_id}".format(
+                        iocid=iocid, record_id=record_id
+                    )
+                )
                 continue
-            pvInfo[rid]["aliases"] = alias
+            recordInfo[record_id]["aliases"] = alias
 
-        for rid in pvInfo:
+        for record_id in recordInfo:
             for epics_env_var_name, cf_prop_name in self.env_vars.items():
-                if TR.infos.get(epics_env_var_name) is not None:
+                if transaction.client_infos.get(epics_env_var_name) is not None:
                     property = {
                         "name": cf_prop_name,
                         "owner": owner,
-                        "value": TR.infos.get(epics_env_var_name),
+                        "value": transaction.client_infos.get(epics_env_var_name),
                     }
-                    if "infoProperties" not in pvInfo[rid]:
-                        pvInfo[rid]["infoProperties"] = list()
-                    pvInfo[rid]["infoProperties"].append(property)
+                    if "infoProperties" not in recordInfo[record_id]:
+                        recordInfo[record_id]["infoProperties"] = list()
+                    recordInfo[record_id]["infoProperties"].append(property)
                 else:
                     _log.debug(
                         "EPICS environment var %s listed in environment_vars setting list not found in this IOC: %s",
@@ -254,22 +266,23 @@ def _commitWithThread(self, TR):
                         iocName,
                     )
 
-        delrec = list(TR.delrec)
-        _log.debug("Delete records: {s}".format(s=delrec))
+        records_to_delete = list(transaction.records_to_delete)
+        _log.debug("Delete records: {s}".format(s=records_to_delete))
 
-        pvInfoByName = {}
-        for rid, (info) in pvInfo.items():
-            if info["pvName"] in pvInfoByName:
+        recordInfoByName = {}
+        for record_id, (info) in recordInfo.items():
+            if info["pvName"] in recordInfoByName:
                 _log.warning(
                     "Commit contains multiple records with PV name: {pv} ({iocid})".format(
                         pv=info["pvName"], iocid=iocid
                     )
                 )
                 continue
-            pvInfoByName[info["pvName"]] = info
-            _log.debug("Add record: {rid}: {info}".format(rid=rid, info=info))
+            recordInfoByName[info["pvName"]] = info
+            _log.debug("Add record: {record_id}: {info}".format(record_id=record_id, info=info))
+            _log.debug("Add record: {record_id}: {info}".format(record_id=record_id, info=info))
 
-        if TR.initial:
+        if transaction.initial:
             """Add IOC to source list """
             self.iocs[iocid] = {
                 "iocname": iocName,
@@ -279,30 +292,30 @@ def _commitWithThread(self, TR):
                 "time": time,
                 "channelcount": 0,
             }
-        if not TR.connected:
-            delrec.extend(self.channel_dict.keys())
-        for pv in pvInfoByName.keys():
-            self.channel_dict[pv].append(iocid)
+        if not transaction.connected:
+            records_to_delete.extend(self.channel_dict.keys())
+        for record_name in recordInfoByName.keys():
+            self.channel_dict[record_name].append(iocid)
             self.iocs[iocid]["channelcount"] += 1
             """In case, alias exists"""
             if self.conf.get("alias"):
-                if pv in pvInfoByName and "aliases" in pvInfoByName[pv]:
-                    for a in pvInfoByName[pv]["aliases"]:
-                        self.channel_dict[a].append(iocid)  # add iocname to pvName in dict
+                if record_name in recordInfoByName and "aliases" in recordInfoByName[record_name]:
+                    for alias in recordInfoByName[record_name]["aliases"]:
+                        self.channel_dict[alias].append(iocid)  # add iocname to pvName in dict
                         self.iocs[iocid]["channelcount"] += 1
-        for pv in delrec:
-            if iocid in self.channel_dict[pv]:
-                self.remove_channel(pv, iocid)
+        for record_name in records_to_delete:
+            if iocid in self.channel_dict[record_name]:
+                self.remove_channel(record_name, iocid)
                 """In case, alias exists"""
                 if self.conf.get("alias"):
-                    if pv in pvInfoByName and "aliases" in pvInfoByName[pv]:
-                        for a in pvInfoByName[pv]["aliases"]:
-                            self.remove_channel(a, iocid)
+                    if record_name in recordInfoByName and "aliases" in recordInfoByName[record_name]:
+                        for alias in recordInfoByName[record_name]["aliases"]:
+                            self.remove_channel(alias, iocid)
         poll(
             __updateCF__,
             self,
-            pvInfoByName,
-            delrec,
+            recordInfoByName,
+            records_to_delete,
             hostName,
             iocName,
             host,
@@ -312,16 +325,16 @@ def _commitWithThread(self, TR):
         )
         dict_to_file(self.channel_dict, self.iocs, self.conf)
 
-    def remove_channel(self, a, iocid):
-        self.channel_dict[a].remove(iocid)
+    def remove_channel(self, recordName, iocid):
+        self.channel_dict[recordName].remove(iocid)
         if iocid in self.iocs:
             self.iocs[iocid]["channelcount"] -= 1
         if self.iocs[iocid]["channelcount"] == 0:
             self.iocs.pop(iocid, None)
         elif self.iocs[iocid]["channelcount"] < 0:
             _log.error("Channel count negative: {s}", s=iocid)
-        if len(self.channel_dict[a]) <= 0:  # case: channel has no more iocs
-            del self.channel_dict[a]
+        if len(self.channel_dict[recordName]) <= 0:  # case: channel has no more iocs
+            del self.channel_dict[recordName]
 
     def clean_service(self):
         """
@@ -361,8 +374,8 @@ def get_active_channels(self, recceiverid):
 
     def clean_channels(self, owner, channels):
         new_channels = []
-        for ch in channels or []:
-            new_channels.append(ch["name"])
+        for cf_channel in channels or []:
+            new_channels.append(cf_channel["name"])
         _log.info("Total channels to update: {nChannels}".format(nChannels=len(new_channels)))
         _log.debug(
             'Update "pvStatus" property to "Inactive" for {n_channels} channels'.format(n_channels=len(new_channels))
@@ -388,16 +401,26 @@ def dict_to_file(dict, iocs, conf):
             json.dump(list, f)
 
 
-def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, owner, iocTime):
+def __updateCF__(
+    processor,
+    recordInfoByName,
+    records_to_delete,
+    hostName,
+    iocName,
+    iocIP,
+    iocid,
+    owner,
+    iocTime,
+):
     _log.info("CF Update IOC: {iocid}".format(iocid=iocid))
 
-    # Consider making this function a class methed then 'proc' simply becomes 'self'
-    client = proc.client
-    channels_dict = proc.channel_dict
-    iocs = proc.iocs
-    conf = proc.conf
+    # Consider making this function a class methed then 'processor' simply becomes 'self'
+    client = processor.client
+    channels_dict = processor.channel_dict
+    iocs = processor.iocs
+    conf = processor.conf
     recceiverid = conf.get(RECCEIVERID_KEY, RECCEIVERID_DEFAULT)
-    new = set(pvInfoByName.keys())
+    new_channels = set(recordInfoByName.keys())
 
     if iocid in iocs:
         hostName = iocs[iocid]["hostname"]
@@ -411,85 +434,87 @@ def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, ow
     if hostName is None or iocName is None:
         raise Exception("missing hostName or iocName")
 
-    if proc.cancelled:
+    if processor.cancelled:
         raise defer.CancelledError()
 
     channels = []
     """A list of channels in channelfinder with the associated hostName and iocName"""
     _log.debug("Find existing channels by IOCID: {iocid}".format(iocid=iocid))
-    old = client.findByArgs(prepareFindArgs(conf, [("iocid", iocid)]))
-    if proc.cancelled:
+    old_channels = client.findByArgs(prepareFindArgs(conf, [("iocid", iocid)]))
+    if processor.cancelled:
         raise defer.CancelledError()
 
-    if old is not None:
-        for ch in old:
-            if len(new) == 0 or ch["name"] in delrec:  # case: empty commit/del, remove all reference to ioc
-                if ch["name"] in channels_dict:
-                    ch["owner"] = iocs[channels_dict[ch["name"]][-1]]["owner"]
-                    ch["properties"] = __merge_property_lists(
-                        ch_create_properties(owner, iocTime, recceiverid, channels_dict, iocs, ch),
-                        ch["properties"],
+    if old_channels is not None:
+        for cf_channel in old_channels:
+            if (
+                len(new_channels) == 0 or cf_channel["name"] in records_to_delete
+            ):  # case: empty commit/del, remove all reference to ioc
+                if cf_channel["name"] in channels_dict:
+                    cf_channel["owner"] = iocs[channels_dict[cf_channel["name"]][-1]]["owner"]
+                    cf_channel["properties"] = __merge_property_lists(
+                        ch_create_properties(owner, iocTime, recceiverid, channels_dict, iocs, cf_channel),
+                        cf_channel["properties"],
                     )
                     if conf.get("recordType"):
-                        ch["properties"] = __merge_property_lists(
-                            ch["properties"].append(
+                        cf_channel["properties"] = __merge_property_lists(
+                            cf_channel["properties"].append(
                                 {
                                     "name": "recordType",
                                     "owner": owner,
-                                    "value": iocs[channels_dict[ch["name"]][-1]]["recordType"],
+                                    "value": iocs[channels_dict[cf_channel["name"]][-1]]["recordType"],
                                 }
                             ),
-                            ch["properties"],
+                            cf_channel["properties"],
                         )
-                    channels.append(ch)
+                    channels.append(cf_channel)
                     _log.debug("Add existing channel to previous IOC: {s}".format(s=channels[-1]))
                     """In case alias exist, also delete them"""
                     if conf.get("alias"):
-                        if ch["name"] in pvInfoByName and "aliases" in pvInfoByName[ch["name"]]:
-                            for a in pvInfoByName[ch["name"]]["aliases"]:
-                                if a["name"] in channels_dict:
-                                    a["owner"] = iocs[channels_dict[a["name"]][-1]]["owner"]
-                                    a["properties"] = __merge_property_lists(
+                        if cf_channel["name"] in recordInfoByName and "aliases" in recordInfoByName[cf_channel["name"]]:
+                            for alias in recordInfoByName[cf_channel["name"]]["aliases"]:
+                                if alias["name"] in channels_dict:
+                                    alias["owner"] = iocs[channels_dict[alias["name"]][-1]]["owner"]
+                                    alias["properties"] = __merge_property_lists(
                                         ch_create_properties(
                                             owner,
                                             iocTime,
                                             recceiverid,
                                             channels_dict,
                                             iocs,
-                                            ch,
+                                            cf_channel,
                                         ),
-                                        a["properties"],
+                                        alias["properties"],
                                     )
                                     if conf.get("recordType", "default") == "on":
-                                        ch["properties"] = __merge_property_lists(
-                                            ch["properties"].append(
+                                        cf_channel["properties"] = __merge_property_lists(
+                                            cf_channel["properties"].append(
                                                 {
                                                     "name": "recordType",
                                                     "owner": owner,
-                                                    "value": iocs[channels_dict[a["name"]][-1]]["recordType"],
+                                                    "value": iocs[channels_dict[alias["name"]][-1]]["recordType"],
                                                 }
                                             ),
-                                            ch["properties"],
+                                            cf_channel["properties"],
                                         )
-                                    channels.append(a)
+                                    channels.append(alias)
                                     _log.debug("Add existing alias to previous IOC: {s}".format(s=channels[-1]))
 
                 else:
                     """Orphan the channel : mark as inactive, keep the old hostName and iocName"""
-                    ch["properties"] = __merge_property_lists(
+                    cf_channel["properties"] = __merge_property_lists(
                         [
                             {"name": "pvStatus", "owner": owner, "value": "Inactive"},
                             {"name": "time", "owner": owner, "value": iocTime},
                         ],
-                        ch["properties"],
+                        cf_channel["properties"],
                     )
-                    channels.append(ch)
+                    channels.append(cf_channel)
                     _log.debug("Add orphaned channel with no IOC: {s}".format(s=channels[-1]))
                     """Also orphan any alias"""
                     if conf.get("alias", "default") == "on":
-                        if ch["name"] in pvInfoByName and "aliases" in pvInfoByName[ch["name"]]:
-                            for a in pvInfoByName[ch["name"]]["aliases"]:
-                                a["properties"] = __merge_property_lists(
+                        if cf_channel["name"] in recordInfoByName and "aliases" in recordInfoByName[cf_channel["name"]]:
+                            for alias in recordInfoByName[cf_channel["name"]]["aliases"]:
+                                alias["properties"] = __merge_property_lists(
                                     [
                                         {
                                             "name": "pvStatus",
@@ -502,34 +527,34 @@ def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, ow
                                             "value": iocTime,
                                         },
                                     ],
-                                    a["properties"],
+                                    alias["properties"],
                                 )
-                                channels.append(a)
+                                channels.append(alias)
                                 _log.debug("Add orphaned alias with no IOC: {s}".format(s=channels[-1]))
             else:
-                if ch["name"] in new:  # case: channel in old and new
+                if cf_channel["name"] in new_channels:  # case: channel in old and new
                     """
                     Channel exists in Channelfinder with same hostname and iocname.
                     Update the status to ensure it is marked active and update the time.
                     """
-                    ch["properties"] = __merge_property_lists(
+                    cf_channel["properties"] = __merge_property_lists(
                         [
                             {"name": "pvStatus", "owner": owner, "value": "Active"},
                             {"name": "time", "owner": owner, "value": iocTime},
                         ],
-                        ch["properties"],
+                        cf_channel["properties"],
                     )
-                    channels.append(ch)
+                    channels.append(cf_channel)
                     _log.debug("Add existing channel with same IOC: {s}".format(s=channels[-1]))
-                    new.remove(ch["name"])
+                    new_channels.remove(cf_channel["name"])
 
                     """In case, alias exist"""
                     if conf.get("alias", "default") == "on":
-                        if ch["name"] in pvInfoByName and "aliases" in pvInfoByName[ch["name"]]:
-                            for a in pvInfoByName[ch["name"]]["aliases"]:
-                                if a in old:
+                        if cf_channel["name"] in recordInfoByName and "aliases" in recordInfoByName[cf_channel["name"]]:
+                            for alias in recordInfoByName[cf_channel["name"]]["aliases"]:
+                                if alias in old_channels:
                                     """alias exists in old list"""
-                                    a["properties"] = __merge_property_lists(
+                                    alias["properties"] = __merge_property_lists(
                                         [
                                             {
                                                 "name": "pvStatus",
@@ -542,10 +567,10 @@ def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, ow
                                                 "value": iocTime,
                                             },
                                         ],
-                                        a["properties"],
+                                        alias["properties"],
                                     )
-                                    channels.append(a)
-                                    new.remove(a["name"])
+                                    channels.append(alias)
+                                    new_channels.remove(alias["name"])
                                 else:
                                     """alias exists but not part of old list"""
                                     aprops = __merge_property_lists(
@@ -563,19 +588,19 @@ def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, ow
                                             {
                                                 "name": "alias",
                                                 "owner": owner,
-                                                "value": ch["name"],
+                                                "value": cf_channel["name"],
                                             },
                                         ],
-                                        ch["properties"],
+                                        cf_channel["properties"],
                                     )
                                     channels.append(
                                         {
-                                            "name": a["name"],
+                                            "name": alias["name"],
                                             "owner": owner,
                                             "properties": aprops,
                                         }
                                     )
-                                    new.remove(a["name"])
+                                    new_channels.remove(alias["name"])
                                 _log.debug("Add existing alias with same IOC: {s}".format(s=channels[-1]))
     # now pvNames contains a list of pv's new on this host/ioc
     """A dictionary representing the current channelfinder information associated with the pvNames"""
@@ -587,77 +612,77 @@ def __updateCF__(proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, ow
     """
     searchStrings = []
     searchString = ""
-    for pv in new:
+    for channel_name in new_channels:
         if not searchString:
-            searchString = pv
-        elif len(searchString) + len(pv) < 600:
-            searchString = searchString + "|" + pv
+            searchString = channel_name
+        elif len(searchString) + len(channel_name) < 600:
+            searchString = searchString + "|" + channel_name
         else:
             searchStrings.append(searchString)
-            searchString = pv
+            searchString = channel_name
     if searchString:
         searchStrings.append(searchString)
 
     for eachSearchString in searchStrings:
         _log.debug("Find existing channels by name: {search}".format(search=eachSearchString))
-        for ch in client.findByArgs(prepareFindArgs(conf, [("~name", eachSearchString)])):
-            existingChannels[ch["name"]] = ch
-        if proc.cancelled:
+        for cf_channel in client.findByArgs(prepareFindArgs(conf, [("~name", eachSearchString)])):
+            existingChannels[cf_channel["name"]] = cf_channel
+        if processor.cancelled:
             raise defer.CancelledError()
 
-    for pv in new:
+    for channel_name in new_channels:
         newProps = create_properties(owner, iocTime, recceiverid, hostName, iocName, iocIP, iocid)
         if conf.get("recordType", "default") == "on":
             newProps.append(
                 {
                     "name": "recordType",
                     "owner": owner,
-                    "value": pvInfoByName[pv]["recordType"],
+                    "value": recordInfoByName[channel_name]["recordType"],
                 }
             )
-        if pv in pvInfoByName and "infoProperties" in pvInfoByName[pv]:
-            newProps = newProps + pvInfoByName[pv]["infoProperties"]
+        if channel_name in recordInfoByName and "infoProperties" in recordInfoByName[channel_name]:
+            newProps = newProps + recordInfoByName[channel_name]["infoProperties"]
 
-        if pv in existingChannels:
+        if channel_name in existingChannels:
             """update existing channel: exists but with a different hostName and/or iocName"""
-            existingChannel = existingChannels[pv]
+            existingChannel = existingChannels[channel_name]
             existingChannel["properties"] = __merge_property_lists(newProps, existingChannel["properties"])
             channels.append(existingChannel)
             _log.debug("Add existing channel with different IOC: {s}".format(s=channels[-1]))
             """in case, alias exists, update their properties too"""
             if conf.get("alias", "default") == "on":
-                if pv in pvInfoByName and "aliases" in pvInfoByName[pv]:
-                    alProps = [{"name": "alias", "owner": owner, "value": pv}]
+                if channel_name in recordInfoByName and "aliases" in recordInfoByName[channel_name]:
+                    alProps = [{"name": "alias", "owner": owner, "value": channel_name}]
                     for p in newProps:
                         alProps.append(p)
-                    for a in pvInfoByName[pv]["aliases"]:
-                        if a in existingChannels:
-                            ach = existingChannels[a]
+                    for alias in recordInfoByName[channel_name]["aliases"]:
+                        if alias in existingChannels:
+                            ach = existingChannels[alias]
                             ach["properties"] = __merge_property_lists(alProps, ach["properties"])
                             channels.append(ach)
                         else:
-                            channels.append({"name": a, "owner": owner, "properties": alProps})
+                            channels.append({"name": alias, "owner": owner, "properties": alProps})
                         _log.debug("Add existing alias with different IOC: {s}".format(s=channels[-1]))
 
         else:
             """New channel"""
-            channels.append({"name": pv, "owner": owner, "properties": newProps})
+            channels.append({"name": channel_name, "owner": owner, "properties": newProps})
             _log.debug("Add new channel: {s}".format(s=channels[-1]))
             if conf.get("alias", "default") == "on":
-                if pv in pvInfoByName and "aliases" in pvInfoByName[pv]:
-                    alProps = [{"name": "alias", "owner": owner, "value": pv}]
+                if channel_name in recordInfoByName and "aliases" in recordInfoByName[channel_name]:
+                    alProps = [{"name": "alias", "owner": owner, "value": channel_name}]
                     for p in newProps:
                         alProps.append(p)
-                    for a in pvInfoByName[pv]["aliases"]:
-                        channels.append({"name": a, "owner": owner, "properties": alProps})
+                    for alias in recordInfoByName[channel_name]["aliases"]:
+                        channels.append({"name": alias, "owner": owner, "properties": alProps})
                         _log.debug("Add new alias: {s}".format(s=channels[-1]))
     _log.info("Total channels to update: {nChannels} {iocName}".format(nChannels=len(channels), iocName=iocName))
     if len(channels) != 0:
         client.set(channels=channels)
     else:
-        if old and len(old) != 0:
+        if old_channels and len(old_channels) != 0:
             client.set(channels=channels)
-    if proc.cancelled:
+    if processor.cancelled:
         raise defer.CancelledError()
 
 
@@ -673,15 +698,15 @@ def create_properties(owner, iocTime, recceiverid, hostName, iocName, iocIP, ioc
     ]
 
 
-def ch_create_properties(owner, iocTime, recceiverid, channels_dict, iocs, ch):
+def ch_create_properties(owner, iocTime, recceiverid, channels_dict, iocs, cf_channel):
     return create_properties(
         owner,
         iocTime,
         recceiverid,
-        iocs[channels_dict[ch["name"]][-1]]["hostname"],
-        iocs[channels_dict[ch["name"]][-1]]["iocname"],
-        iocs[channels_dict[ch["name"]][-1]]["iocIP"],
-        channels_dict[ch["name"]][-1],
+        iocs[channels_dict[cf_channel["name"]][-1]]["hostname"],
+        iocs[channels_dict[cf_channel["name"]][-1]]["iocname"],
+        iocs[channels_dict[cf_channel["name"]][-1]]["iocIP"],
+        channels_dict[cf_channel["name"]][-1],
     )
 
 
@@ -711,16 +736,27 @@ def prepareFindArgs(conf, args, size=0):
     return args
 
 
-def poll(update, proc, pvInfoByName, delrec, hostName, iocName, iocIP, iocid, owner, iocTime):
+def poll(
+    update_method,
+    processor,
+    recordInfoByName,
+    records_to_delete,
+    hostName,
+    iocName,
+    iocIP,
+    iocid,
+    owner,
+    iocTime,
+):
     _log.info("Polling {iocName} begins...".format(iocName=iocName))
     sleep = 1
     success = False
     while not success:
         try:
-            update(
-                proc,
-                pvInfoByName,
-                delrec,
+            update_method(
+                processor,
+                recordInfoByName,
+                records_to_delete,
                 hostName,
                 iocName,
                 iocIP,
diff --git a/server/recceiver/dbstore.py b/server/recceiver/dbstore.py
index f5865c8c..5c43fdf1 100644
--- a/server/recceiver/dbstore.py
+++ b/server/recceiver/dbstore.py
@@ -84,79 +84,91 @@ def cleanupDB(self, cur):
         cur.execute("PRAGMA foreign_keys = ON;")
         cur.execute("DELETE FROM %s WHERE owner=?" % self.tserver, self.mykey)
 
-    def commit(self, TR):
-        return self.pool.runInteraction(self._commit, TR)
+    def commit(self, transaction):
+        return self.pool.runInteraction(self._commit, transaction)
 
-    def _commit(self, cur, TR):
+    def _commit(self, cur, transaction):
         cur.execute("PRAGMA foreign_keys = ON;")
 
-        if not TR.initial:
-            srvid = self.sources[TR.srcid]
+        if not transaction.initial:
+            srvid = self.sources[transaction.srcid]
         else:
             cur.execute(
                 "INSERT INTO %s (hostname,port,owner) VALUES (?,?,?)" % self.tserver,
-                (TR.src.host, TR.src.port, self.mykey),
+                (
+                    transaction.source_address.host,
+                    transaction.source_address.port,
+                    self.mykey,
+                ),
             )
             cur.execute(
                 "SELECT id FROM %s WHERE hostname=? AND port=? AND owner=?" % self.tserver,
-                (TR.src.host, TR.src.port, self.mykey),
+                (
+                    transaction.source_address.host,
+                    transaction.source_address.port,
+                    self.mykey,
+                ),
             )
             R = cur.fetchone()
             srvid = R[0]
-            self.sources[TR.srcid] = srvid
+            self.sources[transaction.srcid] = srvid
 
-        if not TR.connected:
+        if not transaction.connected:
             cur.execute(
                 "DELETE FROM %s where id=? AND owner=?" % self.tserver,
                 (srvid, self.mykey),
             )
-            del self.sources[TR.srcid]
+            del self.sources[transaction.srcid]
             return
 
-        # update client-wide infos
+        # update client-wide client_infos
         cur.executemany(
             "INSERT OR REPLACE INTO %s (host,key,value) VALUES (?,?,?)" % self.tinfo,
-            [(srvid, K, V) for K, V in TR.infos.items()],
+            [(srvid, K, V) for K, V in transaction.client_infos.items()],
         )
 
         # Remove all records, including those which will be re-created
         cur.executemany(
             "DELETE FROM %s WHERE host=? AND id=?" % self.trecord,
             itertools.chain(
-                [(srvid, recid) for recid in TR.addrec],
-                [(srvid, recid) for recid in TR.delrec],
+                [(srvid, recid) for recid in transaction.records_to_add],
+                [(srvid, recid) for recid in transaction.records_to_delete],
             ),
         )
 
         # Start new records
         cur.executemany(
-            "INSERT INTO %s (host, id, rtype) VALUES (?,?,?)" % self.trecord,
-            [(srvid, recid, rtype) for recid, (rname, rtype) in TR.addrec.items()],
+            "INSERT INTO %s (host, id, record_type) VALUES (?,?,?)" % self.trecord,
+            [(srvid, recid, record_type) for recid, (record_name, record_type) in transaction.records_to_add.items()],
         )
 
         # Add primary record names
         cur.executemany(
-            """INSERT INTO %s (rec, rname, prim) VALUES (
+            """INSERT INTO %s (rec, record_name, prim) VALUES (
                          (SELECT pkey FROM %s WHERE id=? AND host=?)
                          ,?,1)"""
             % (self.tname, self.trecord),
-            [(recid, srvid, rname) for recid, (rname, rtype) in TR.addrec.items()],
+            [(recid, srvid, record_name) for recid, (record_name, record_type) in transaction.records_to_add.items()],
         )
 
         # Add new record aliases
         cur.executemany(
-            """INSERT INTO %(name)s (rec, rname, prim) VALUES (
+            """INSERT INTO %(name)s (rec, record_name, prim) VALUES (
                          (SELECT pkey FROM %(rec)s WHERE id=? AND host=?)
                          ,?,0)"""
             % {"name": self.tname, "rec": self.trecord},
-            [(recid, srvid, rname) for recid, names in TR.aliases.items() for rname in names],
+            [(recid, srvid, record_name) for recid, names in transaction.aliases.items() for record_name in names],
         )
 
-        # add record infos
+        # add record client_infos
         cur.executemany(
             """INSERT OR REPLACE INTO %s (rec,key,value) VALUES (
                          (SELECT pkey FROM %s WHERE id=? AND host=?)
                          ,?,?)"""
             % (self.trecinfo, self.trecord),
-            [(recid, srvid, K, V) for recid, infos in TR.recinfos.items() for K, V in infos.items()],
+            [
+                (recid, srvid, K, V)
+                for recid, client_infos in transaction.record_infos_to_add.items()
+                for K, V in client_infos.items()
+            ],
         )
diff --git a/server/recceiver/interfaces.py b/server/recceiver/interfaces.py
index 96c95efb..6a139109 100644
--- a/server/recceiver/interfaces.py
+++ b/server/recceiver/interfaces.py
@@ -6,17 +6,17 @@
 
 
 class ITransaction(Interface):
-    src = Attribute("Source Address.")
+    source_address = Attribute("Source Address.")
 
-    addrec = Attribute("""Records being added
+    records_to_add = Attribute("""Records being added
     {recid: ('recname', 'rectype', {'key':'val'})}
     """)
 
-    delrec = Attribute("A set() of recids which are being removed")
+    records_to_delete = Attribute("A set() of recids which are being removed")
 
-    infos = Attribute("A dictionary of new client wide infos")
+    client_infos = Attribute("A dictionary of new client wide infos")
 
-    recinfos = Attribute("""Additional infos being added to existing records
+    record_infos_to_add = Attribute("""Additional infos being added to existing records
     recid: {'key':'val'}
     """)
 
diff --git a/server/recceiver/processors.py b/server/recceiver/processors.py
index c0e60cea..b47823ff 100644
--- a/server/recceiver/processors.py
+++ b/server/recceiver/processors.py
@@ -158,16 +158,18 @@ def releaseLock(result):
 
     def _commit(self, trans):
         _log.debug("# Show processor '{name}' commit".format(name=self.name))
-        _log.info("# From {host}:{port}".format(host=trans.src.host, port=trans.src.port))
+        _log.info("# From {host}:{port}".format(host=trans.source_address.host, port=trans.source_address.port))
         if not trans.connected:
             _log.info("#  connection lost")
-        for item in trans.infos.items():
+        for item in trans.client_infos.items():
             _log.info(" epicsEnvSet('{name}','{value}')".format(name=item[0], value=item[1]))
-        for rid, (rname, rtype) in trans.addrec.items():
-            _log.info(' record({rtype}, "{rname}") {{'.format(rtype=rtype, rname=rname))
-            for alias in trans.aliases.get(rid, []):
+        for record_id, (record_name, record_type) in trans.records_to_add.items():
+            _log.info(
+                ' record({record_type}, "{record_name}") {{'.format(record_type=record_type, record_name=record_name)
+            )
+            for alias in trans.aliases.get(record_id, []):
                 _log.info('  alias("{alias}")'.format(alias=alias))
-            for item in trans.recinfos.get(rid, {}).items():
+            for item in trans.record_infos_to_add.get(record_id, {}).items():
                 _log.info('  info({name},"{value}")'.format(name=item[0], value=[1]))
             _log.info(" }")
             yield
@@ -183,8 +185,8 @@ class ProcessorFactory(object):
     name = None
     processor = None
 
-    def __init__(self, name, proc):
-        self.name, self.processor = name, proc
+    def __init__(self, name, processor):
+        self.name, self.processor = name, processor
 
     def build(self, name, opts):
         P = self.processor(name, opts)
diff --git a/server/recceiver/recast.py b/server/recceiver/recast.py
index 0b49359c..3c0c6e30 100644
--- a/server/recceiver/recast.py
+++ b/server/recceiver/recast.py
@@ -145,7 +145,7 @@ def recvPong(self, body):
 
     # 0x0006
     def recvInfo(self, body):
-        rid, klen, vlen = _c_info.unpack(body[: _c_info.size])
+        record_id, klen, vlen = _c_info.unpack(body[: _c_info.size])
         text = body[_c_info.size :]
         text = text.decode()
         if klen == 0 or klen + vlen < len(text):
@@ -153,35 +153,35 @@ def recvInfo(self, body):
             return self.getInitialState()
         key = text[:klen]
         val = text[klen : klen + vlen]
-        if rid:
-            self.sess.recInfo(rid, key, val)
+        if record_id:
+            self.sess.recInfo(record_id, key, val)
         else:
             self.sess.iocInfo(key, val)
         return self.getInitialState()
 
     # 0x0003
     def recvAddRec(self, body):
-        rid, rtype, rtlen, rnlen = _c_rec.unpack(body[: _c_rec.size])
+        record_id, record_type, rtlen, rnlen = _c_rec.unpack(body[: _c_rec.size])
         text = body[_c_rec.size :]
         text = text.decode()
         if rnlen == 0 or rtlen + rnlen < len(text):
             _log.error("Ignoring record update")
 
-        elif rtlen > 0 and rtype == 0:  # new record
+        elif rtlen > 0 and record_type == 0:  # new record
             rectype = text[:rtlen]
             recname = text[rtlen : rtlen + rnlen]
-            self.sess.addRecord(rid, rectype, recname)
+            self.sess.addRecord(record_id, rectype, recname)
 
-        elif rtype == 1:  # record alias
+        elif record_type == 1:  # record alias
             recname = text[rtlen : rtlen + rnlen]
-            self.sess.addAlias(rid, recname)
+            self.sess.addAlias(record_id, recname)
 
         return self.getInitialState()
 
     # 0x0004
     def recvDelRec(self, body):
-        rid = _ping.unpack(body[: _ping.size])
-        self.sess.delRecord(rid)
+        record_id = _ping.unpack(body[: _ping.size])
+        self.sess.delRecord(record_id)
         return self.getInitialState()
 
     # 0x0005
@@ -194,10 +194,13 @@ def recvDone(self, body):
         elapsed_s = time.time() - self.uploadStart
         size_kb = self.uploadSize / 1024
         rate_kbs = size_kb / elapsed_s
-        src = "{}:{}".format(self.sess.ep.host, self.sess.ep.port)
+        source_address = "{}:{}".format(self.sess.ep.host, self.sess.ep.port)
         _log.info(
-            "Done message from {src}: uploaded {size_kb}kB in {elapsed_s}s ({rate_kbs}kB/s)".format(
-                src=src, size_kb=size_kb, elapsed_s=elapsed_s, rate_kbs=rate_kbs
+            "Done message from {source_address}: uploaded {size_kb}kB in {elapsed_s}s ({rate_kbs}kB/s)".format(
+                source_address=source_address,
+                size_kb=size_kb,
+                elapsed_s=elapsed_s,
+                rate_kbs=rate_kbs,
             )
         )
 
@@ -216,26 +219,26 @@ class Transaction(object):
     def __init__(self, ep, id):
         self.connected = True
         self.initial = False
-        self.src = ep
+        self.source_address = ep
         self.srcid = id
-        self.addrec, self.infos, self.recinfos = {}, {}, {}
+        self.records_to_add, self.client_infos, self.record_infos_to_add = {}, {}, {}
         self.aliases = collections.defaultdict(list)
-        self.delrec = set()
+        self.records_to_delete = set()
 
     def show(self, fp=sys.stdout):
         _log.info(str(self))
 
     def __str__(self):
-        src = "{}:{}".format(self.src.host, self.src.port)
+        source_address = "{}:{}".format(self.source_address.host, self.source_address.port)
         init = self.initial
         conn = self.connected
-        nenv = len(self.infos)
-        nadd = len(self.addrec)
-        ndel = len(self.delrec)
-        ninfo = len(self.recinfos)
+        nenv = len(self.client_infos)
+        nadd = len(self.records_to_add)
+        ndel = len(self.records_to_delete)
+        ninfo = len(self.record_infos_to_add)
         nalias = len(self.aliases)
         return "Transaction(Src:{}, Init:{}, Conn:{}, Env:{}, Rec:{}, Alias:{}, Info:{}, Del:{})".format(
-            src, init, conn, nenv, nadd, nalias, ninfo, ndel
+            source_address, init, conn, nenv, nadd, nalias, ninfo, ndel
         )
 
 
@@ -249,8 +252,8 @@ def __init__(self, proto, endpoint):
         _log.info("Open session from {endpoint}".format(endpoint=endpoint))
         self.reactor = reactor
         self.proto, self.ep = proto, endpoint
-        self.TR = Transaction(self.ep, id(self))
-        self.TR.initial = True
+        self.transaction = Transaction(self.ep, id(self))
+        self.transaction.initial = True
         self.C = defer.succeed(None)
         self.T = None
         self.dirty = False
@@ -267,8 +270,8 @@ def suppressCancelled(err):
 
         # Clear the current transaction and
         # commit an empty one for disconnect.
-        self.TR = Transaction(self.ep, id(self))
-        self.TR.connected = False
+        self.transaction = Transaction(self.ep, id(self))
+        self.transaction.connected = False
         self.dirty = True
         self.flush()
 
@@ -278,16 +281,16 @@ def flush(self, connected=True):
         if not self.dirty:
             return
 
-        TR, self.TR = self.TR, Transaction(self.ep, id(self))
+        transaction, self.transaction = self.transaction, Transaction(self.ep, id(self))
         self.dirty = False
 
         def commit(_ignored):
-            _log.info("Commit: {TR}".format(TR=TR))
-            return defer.maybeDeferred(self.factory.commit, TR)
+            _log.info("Commit: {transaction}".format(transaction=transaction))
+            return defer.maybeDeferred(self.factory.commit, transaction)
 
         def abort(err):
             if err.check(defer.CancelledError):
-                _log.info("Commit cancelled: {TR}".format(TR=TR))
+                _log.info("Commit cancelled: {transaction}".format(transaction=transaction))
                 return err
             else:
                 _log.error("Commit failure: {err}".format(err=err))
@@ -302,7 +305,9 @@ def abort(err):
     def flushSafely(self):
         if self.T and self.T <= time.time():
             self.flush()
-        elif self.trlimit and self.trlimit <= (len(self.TR.addrec) + len(self.TR.delrec)):
+        elif self.trlimit and self.trlimit <= (
+            len(self.transaction.records_to_add) + len(self.transaction.records_to_delete)
+        ):
             self.flush()
 
     def markDirty(self):
@@ -314,32 +319,32 @@ def done(self):
         self.flush()
 
     def iocInfo(self, key, val):
-        self.TR.infos[key] = val
+        self.transaction.client_infos[key] = val
         self.markDirty()
 
-    def addRecord(self, rid, rtype, rname):
+    def addRecord(self, record_id, record_type, record_name):
         self.flushSafely()
-        self.TR.addrec[rid] = (rname, rtype)
+        self.transaction.records_to_add[record_id] = (record_name, record_type)
         self.markDirty()
 
-    def addAlias(self, rid, rname):
-        self.TR.aliases[rid].append(rname)
+    def addAlias(self, record_id, record_name):
+        self.transaction.aliases[record_id].append(record_name)
         self.markDirty()
 
-    def delRecord(self, rid):
+    def delRecord(self, record_id):
         self.flushSafely()
-        self.TR.addrec.pop(rid, None)
-        self.TR.delrec.add(rid)
-        self.TR.recinfos.pop(rid, None)
+        self.transaction.records_to_add.pop(record_id, None)
+        self.transaction.records_to_delete.add(record_id)
+        self.transaction.record_infos_to_add.pop(record_id, None)
         self.markDirty()
 
-    def recInfo(self, rid, key, val):
+    def recInfo(self, record_id, key, val):
         try:
-            infos = self.TR.recinfos[rid]
+            client_infos = self.transaction.record_infos_to_add[record_id]
         except KeyError:
-            infos = {}
-            self.TR.recinfos[rid] = infos
-        infos[key] = val
+            client_infos = {}
+            self.transaction.record_infos_to_add[record_id] = client_infos
+        client_infos[key] = val
         self.markDirty()
 
 
diff --git a/server/recceiver/scripts/print_cf_data.py b/server/recceiver/scripts/print_cf_data.py
index e6b949ff..2951565e 100644
--- a/server/recceiver/scripts/print_cf_data.py
+++ b/server/recceiver/scripts/print_cf_data.py
@@ -11,15 +11,15 @@
 def get_cf_data(client):
     channels = client.findByArgs([("pvStatus", "Active")])
 
-    for ch in channels:
-        ch.pop("owner", None)
-        ch.pop("tags", None)
-        for prop in ch["properties"]:
-            if prop["name"] == "hostName":
-                ch["hostName"] = prop["value"]
-            if prop["name"] == "iocName":
-                ch["iocName"] = prop["value"]
-        ch.pop("properties", None)
+    for cf_channel in channels:
+        cf_channel.pop("owner", None)
+        cf_channel.pop("tags", None)
+        for cf_property in cf_channel["properties"]:
+            if cf_property["name"] == "hostName":
+                cf_channel["hostName"] = cf_property["value"]
+            if cf_property["name"] == "iocName":
+                cf_channel["iocName"] = cf_property["value"]
+        cf_channel.pop("properties", None)
     return channels
 
 


Reviews:
user: login: anderslindho
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-10T15:43:36Z
user: login: anderslindho
body: Some seem a little bit overkill to me, like `cf_properties` and `cf_channels` (should it then also be `new_cf_channels`, etc?), but overall fine. Will approve but would be nice if you fixed the camelCase var I dropped a comment on
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T17:06:07Z

Review comments:
diff_hunk: @@ -1,7 +1,7 @@
 from channelfinder import ChannelFinderClient
 
 """
-Simple script for adding active channels to Channel Finder Service for testing cf-store clean
path: server/recceiver/scripts/add_extra_properties.py
user: login: anderslindho
body: channels actually seems appropriate here
created_at: 2025-03-10T15:42:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -8,29 +8,29 @@
 
 
 def get_cf_data(client):
-    channels = client.findByArgs([("pvStatus", "Active")])
+    records = client.findByArgs([("pvStatus", "Active")])
 
-    for ch in channels:
-        ch.pop("owner", None)
-        ch.pop("tags", None)
-        for prop in ch["properties"]:
-            if prop["name"] == "hostName":
-                ch["hostName"] = prop["value"]
-            if prop["name"] == "iocName":
-                ch["iocName"] = prop["value"]
-        ch.pop("properties", None)
-    return channels
+    for cf_record in records:
path: server/recceiver/scripts/print_cf_data.py
user: login: anderslindho
body: same here
created_at: 2025-03-10T15:43:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,7 +17,7 @@ Clean and poll on recsync start:
     - polling completes
 4. CF will clean
 5. Check result
-    - all channels inactive
+    - all records inactive
path: server/recceiver/scripts/readme
user: login: anderslindho
body: and so on 😬 

maybe drop commit(s) converting channels to records and similar
created_at: 2025-03-10T15:43:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -213,14 +213,14 @@ def _commitWithThread(self, transaction):
         """The unique identifier for a particular IOC"""
         iocid = host + ":" + str(port)
 
-        pvInfo = {}
+        recordInfo = {}
path: server/recceiver/cfstore.py
user: login: anderslindho
body: Maybe fix the naming style in the same go?
created_at: 2025-03-12T17:03:17Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-03-12T09:50:15Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=ChannelFinder_recsync&pullRequest=104) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [22 New issues](https://sonarcloud.io/project/issues?id=ChannelFinder_recsync&pullRequest=104&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=ChannelFinder_recsync&pullRequest=104&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=ChannelFinder_recsync&pullRequest=104&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=ChannelFinder_recsync&pullRequest=104&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=ChannelFinder_recsync&pullRequest=104&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=ChannelFinder_recsync&pullRequest=104)


author_association: NONE