diff --git a/server/recceiver/scripts/add_extra_properties.py b/server/recceiver/scripts/add_extra_properties.py deleted file mode 100644 index a02cf70b..00000000 --- a/server/recceiver/scripts/add_extra_properties.py +++ /dev/null @@ -1,32 +0,0 @@ -from channelfinder import ChannelFinderClient - -""" -Simple script for adding active channels to Channel Finder Service for testing cf-store clean -If it gives a 500 error, run it again. Glassfish and CFS must be set up and running. -""" - - -def abbr(name, hostname, iocname, status): - return { - "owner": "cf-update", - "name": name, - "properties": [ - {"owner": "cf-update", "name": "hostName", "value": hostname}, - {"owner": "cf-update", "name": "iocName", "value": iocname}, - {"owner": "cf-update", "name": "pvStatus", "value": status}, - { - "owner": "cf-update", - "name": "time", - "value": "2016-08-18 12:33:09.953985", - }, - ], - } - - -client = ChannelFinderClient() -client.set( - channels=[ - abbr("ch1", "testhosta", 1111, "Active"), - abbr("test_channel", "testhosta", 1111, "Active"), - ] -) diff --git a/server/recceiver/scripts/print_cf_data.py b/server/recceiver/scripts/print_cf_data.py deleted file mode 100644 index 2951565e..00000000 --- a/server/recceiver/scripts/print_cf_data.py +++ /dev/null @@ -1,39 +0,0 @@ -import json -import os -from operator import itemgetter - -from channelfinder import ChannelFinderClient - -filename = "/home/devuser/cfdata" # change this to output file name -client = ChannelFinderClient() - - -def get_cf_data(client): - channels = client.findByArgs([("pvStatus", "Active")]) - - 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 - - -channels = get_cf_data(client) - -if os.path.isfile(filename): - os.remove(filename) - -new_list = [] - -for channel in channels: - new_list.append([channel["name"], channel["hostName"], int(channel["iocName"])]) - -new_list.sort(key=itemgetter(0)) - -with open(filename, "x") as f: - json.dump(new_list, f)