Skip to content

Commit 3acec8f

Browse files
committed
consistency of channel vs record name
record name comes from a transaction, channel name comes from channelfinder.
1 parent 335ac3b commit 3acec8f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

server/recceiver/cfstore.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -612,14 +612,14 @@ def __updateCF__(
612612
"""
613613
searchStrings = []
614614
searchString = ""
615-
for record_name in new_channels:
615+
for channel_name in new_channels:
616616
if not searchString:
617-
searchString = record_name
618-
elif len(searchString) + len(record_name) < 600:
619-
searchString = searchString + "|" + record_name
617+
searchString = channel_name
618+
elif len(searchString) + len(channel_name) < 600:
619+
searchString = searchString + "|" + channel_name
620620
else:
621621
searchStrings.append(searchString)
622-
searchString = record_name
622+
searchString = channel_name
623623
if searchString:
624624
searchStrings.append(searchString)
625625

@@ -630,32 +630,32 @@ def __updateCF__(
630630
if processor.cancelled:
631631
raise defer.CancelledError()
632632

633-
for record_name in new_channels:
633+
for channel_name in new_channels:
634634
newProps = create_properties(owner, iocTime, recceiverid, hostName, iocName, iocIP, iocid)
635635
if conf.get("recordType", "default") == "on":
636636
newProps.append(
637637
{
638638
"name": "recordType",
639639
"owner": owner,
640-
"value": recordInfoByName[record_name]["recordType"],
640+
"value": recordInfoByName[channel_name]["recordType"],
641641
}
642642
)
643-
if record_name in recordInfoByName and "infoProperties" in recordInfoByName[record_name]:
644-
newProps = newProps + recordInfoByName[record_name]["infoProperties"]
643+
if channel_name in recordInfoByName and "infoProperties" in recordInfoByName[channel_name]:
644+
newProps = newProps + recordInfoByName[channel_name]["infoProperties"]
645645

646-
if record_name in existingChannels:
646+
if channel_name in existingChannels:
647647
"""update existing channel: exists but with a different hostName and/or iocName"""
648-
existingChannel = existingChannels[record_name]
648+
existingChannel = existingChannels[channel_name]
649649
existingChannel["properties"] = __merge_property_lists(newProps, existingChannel["properties"])
650650
channels.append(existingChannel)
651651
_log.debug("Add existing channel with different IOC: {s}".format(s=channels[-1]))
652652
"""in case, alias exists, update their properties too"""
653653
if conf.get("alias", "default") == "on":
654-
if record_name in recordInfoByName and "aliases" in recordInfoByName[record_name]:
655-
alProps = [{"name": "alias", "owner": owner, "value": record_name}]
654+
if channel_name in recordInfoByName and "aliases" in recordInfoByName[channel_name]:
655+
alProps = [{"name": "alias", "owner": owner, "value": channel_name}]
656656
for p in newProps:
657657
alProps.append(p)
658-
for alias in recordInfoByName[record_name]["aliases"]:
658+
for alias in recordInfoByName[channel_name]["aliases"]:
659659
if alias in existingChannels:
660660
ach = existingChannels[alias]
661661
ach["properties"] = __merge_property_lists(alProps, ach["properties"])
@@ -666,14 +666,14 @@ def __updateCF__(
666666

667667
else:
668668
"""New channel"""
669-
channels.append({"name": record_name, "owner": owner, "properties": newProps})
669+
channels.append({"name": channel_name, "owner": owner, "properties": newProps})
670670
_log.debug("Add new channel: {s}".format(s=channels[-1]))
671671
if conf.get("alias", "default") == "on":
672-
if record_name in recordInfoByName and "aliases" in recordInfoByName[record_name]:
673-
alProps = [{"name": "alias", "owner": owner, "value": record_name}]
672+
if channel_name in recordInfoByName and "aliases" in recordInfoByName[channel_name]:
673+
alProps = [{"name": "alias", "owner": owner, "value": channel_name}]
674674
for p in newProps:
675675
alProps.append(p)
676-
for alias in recordInfoByName[record_name]["aliases"]:
676+
for alias in recordInfoByName[channel_name]["aliases"]:
677677
channels.append({"name": alias, "owner": owner, "properties": alProps})
678678
_log.debug("Add new alias: {s}".format(s=channels[-1]))
679679
_log.info("Total channels to update: {nChannels} {iocName}".format(nChannels=len(channels), iocName=iocName))

0 commit comments

Comments
 (0)