-def getRMRTable(config):
- myKey= "rmr";
- if myKey not in config:
- print(("Error ! No information found for {0} in config\n".format(myKey)));
- return False;
-
- # Get the rmr routing table
- if "file_path" not in config[myKey]:
- print(("Warning ! No file path specified to store seed routing table. Choosing default = {1}\n".format(default_routing_file)));
- route_file = default_routing_file;
- else:
- route_file = config[myKey]["file_path"];
-
- # Get the rmr routing table contents
- if "contents" not in config[myKey]:
- print("No contents for routing table found in config");
- return False;
- else:
- route_contents = config[myKey]["contents"];
-
- # Get directory : if not exists create it
- directory = os.path.dirname(route_file);
- if not os.path.exists(directory):
- # create directory
- try:
- os.mkdir(directory);
- except OSError as oe:
- print(("Error making directory {0}. Reason = {1}\n".format(directory, oe)));
- return False;
-
- # Write contents to file
- try:
- with open(route_file, "w") as f :
- f.write(config[myKey]["contents"]);
- f.close();
- except Exception as e:
- print(("Error writing contents to file {0}. Reason = {1}\n".format(route_file, e)));
- return False;
+# for k2 in config[k1].keys():
+ #print(k2);
+# if k2 in ParseSection:
+# result = ParseSection[k2](config[k1]);
+# if result == False:
+# return False;