@@ -88,9 +88,9 @@ def _startServiceWithLock(self):
8888 RECCEIVERID_KEY ,
8989 }
9090
91- if self .conf .get ("alias" ):
91+ if self .conf .getboolean ("alias" ):
9292 required_properties .add ("alias" )
93- if self .conf .get ("recordType" ):
93+ if self .conf .getboolean ("recordType" ):
9494 required_properties .add ("recordType" )
9595 env_vars_setting = self .conf .get ("environment_vars" )
9696 self .env_vars = {}
@@ -101,7 +101,8 @@ def _startServiceWithLock(self):
101101 required_properties .add (cf_prop_name )
102102 # Standard property names for CA/PVA name server connections. These are
103103 # environment variables from reccaster so take advantage of env_vars
104- if self .conf .get ("iocConnectionInfo" ):
104+ # iocConnectionInfo enabled by default
105+ if self .conf .getboolean ("iocConnectionInfo" , True ):
105106 self .env_vars ["RSRV_SERVER_PORT" ] = "caPort"
106107 self .env_vars ["PVAS_SERVER_PORT" ] = "pvaPort"
107108 required_properties .add ("caPort" )
@@ -111,7 +112,7 @@ def _startServiceWithLock(self):
111112 record_property_names_list = [s .strip (", " ) for s in infotags_whitelist .split ()]
112113 else :
113114 record_property_names_list = []
114- if self .conf .get ("recordDesc" ):
115+ if self .conf .getboolean ("recordDesc" ):
115116 record_property_names_list .append ("recordDesc" )
116117 # Are any required properties not already present on CF?
117118 properties = required_properties - set (cf_properties )
@@ -219,7 +220,7 @@ def _commitWithThread(self, transaction):
219220 recordInfo = {}
220221 for record_id , (record_name , record_type ) in transaction .records_to_add .items ():
221222 recordInfo [record_id ] = {"pvName" : record_name }
222- if self .conf .get ("recordType" ):
223+ if self .conf .getboolean ("recordType" ):
223224 recordInfo [record_id ]["recordType" ] = record_type
224225 for record_id , (record_infos_to_add ) in transaction .record_infos_to_add .items ():
225226 # find intersection of these sets
@@ -293,7 +294,7 @@ def _commitWithThread(self, transaction):
293294 self .channel_dict [record_name ].append (iocid )
294295 self .iocs [iocid ]["channelcount" ] += 1
295296 """In case, alias exists"""
296- if self .conf .get ("alias" ):
297+ if self .conf .getboolean ("alias" ):
297298 if record_name in recordInfoByName and "aliases" in recordInfoByName [record_name ]:
298299 for alias in recordInfoByName [record_name ]["aliases" ]:
299300 self .channel_dict [alias ].append (iocid ) # add iocname to pvName in dict
@@ -302,7 +303,7 @@ def _commitWithThread(self, transaction):
302303 if iocid in self .channel_dict [record_name ]:
303304 self .remove_channel (record_name , iocid )
304305 """In case, alias exists"""
305- if self .conf .get ("alias" ):
306+ if self .conf .getboolean ("alias" ):
306307 if record_name in recordInfoByName and "aliases" in recordInfoByName [record_name ]:
307308 for alias in recordInfoByName [record_name ]["aliases" ]:
308309 self .remove_channel (alias , iocid )
@@ -496,7 +497,7 @@ def __updateCF__(
496497 cf_channel ,
497498 processor .managed_properties ,
498499 )
499- if conf .get ("recordType" ):
500+ if conf .getboolean ("recordType" ):
500501 cf_channel ["properties" ] = __merge_property_lists (
501502 cf_channel ["properties" ].append (
502503 create_recordType_property (
@@ -509,7 +510,7 @@ def __updateCF__(
509510 channels .append (cf_channel )
510511 _log .debug ("Add existing channel to previous IOC: {s}" .format (s = channels [- 1 ]))
511512 """In case alias exist, also delete them"""
512- if conf .get ("alias" ):
513+ if conf .getboolean ("alias" ):
513514 if cf_channel ["name" ] in recordInfoByName and "aliases" in recordInfoByName [cf_channel ["name" ]]:
514515 for alias in recordInfoByName [cf_channel ["name" ]]["aliases" ]:
515516 if alias ["name" ] in channels_dict :
@@ -526,7 +527,7 @@ def __updateCF__(
526527 alias ,
527528 processor .managed_properties ,
528529 )
529- if conf .get ("recordType" ):
530+ if conf .getboolean ("recordType" ):
530531 cf_channel ["properties" ] = __merge_property_lists (
531532 cf_channel ["properties" ].append (
532533 create_recordType_property (
@@ -552,7 +553,7 @@ def __updateCF__(
552553 channels .append (cf_channel )
553554 _log .debug ("Add orphaned channel with no IOC: {s}" .format (s = channels [- 1 ]))
554555 """Also orphan any alias"""
555- if conf .get ("alias" ):
556+ if conf .getboolean ("alias" ):
556557 if cf_channel ["name" ] in recordInfoByName and "aliases" in recordInfoByName [cf_channel ["name" ]]:
557558 for alias in recordInfoByName [cf_channel ["name" ]]["aliases" ]:
558559 alias ["properties" ] = __merge_property_lists (
@@ -588,7 +589,7 @@ def __updateCF__(
588589 new_channels .remove (cf_channel ["name" ])
589590
590591 """In case, alias exist"""
591- if conf .get ("alias" ):
592+ if conf .getboolean ("alias" ):
592593 if cf_channel ["name" ] in recordInfoByName and "aliases" in recordInfoByName [cf_channel ["name" ]]:
593594 for alias in recordInfoByName [cf_channel ["name" ]]["aliases" ]:
594595 if alias in old_channels :
@@ -656,7 +657,7 @@ def __updateCF__(
656657
657658 for channel_name in new_channels :
658659 newProps = create_properties (owner , iocTime , recceiverid , hostName , iocName , iocIP , iocid )
659- if conf .get ("recordType" ):
660+ if conf .getboolean ("recordType" ):
660661 newProps .append (create_recordType_property (owner , recordInfoByName [channel_name ]["recordType" ]))
661662 if channel_name in recordInfoByName and "infoProperties" in recordInfoByName [channel_name ]:
662663 newProps = newProps + recordInfoByName [channel_name ]["infoProperties" ]
@@ -675,7 +676,7 @@ def __updateCF__(
675676 channels .append (existingChannel )
676677 _log .debug ("Add existing channel with different IOC: {s}" .format (s = channels [- 1 ]))
677678 """in case, alias exists, update their properties too"""
678- if conf .get ("alias" ):
679+ if conf .getboolean ("alias" ):
679680 if channel_name in recordInfoByName and "aliases" in recordInfoByName [channel_name ]:
680681 alProps = [create_alias_property (owner , channel_name )]
681682 for p in newProps :
@@ -697,7 +698,7 @@ def __updateCF__(
697698 """New channel"""
698699 channels .append ({"name" : channel_name , "owner" : owner , "properties" : newProps })
699700 _log .debug ("Add new channel: {s}" .format (s = channels [- 1 ]))
700- if conf .get ("alias" ):
701+ if conf .getboolean ("alias" ):
701702 if channel_name in recordInfoByName and "aliases" in recordInfoByName [channel_name ]:
702703 alProps = [create_alias_property (owner , channel_name )]
703704 for p in newProps :
0 commit comments