Move all rules to "share" directory.

And load rules from the "var" directory if there are any, allowing for
over riding.
This commit is contained in:
Erik Ogenvik 2018-05-16 11:51:48 +02:00
parent 66baf9c9dc
commit 3ad6d2ad8d
525 changed files with 20 additions and 23 deletions

View file

@ -969,14 +969,14 @@ void init_python_api(const std::string & ruleset, bool log_stdout)
PyList_Append(sys_path, path);
Py_DECREF(path);
p = share_directory + "/cyphesis/rulesets/basic";
p = share_directory + "/cyphesis/rulesets/basic/scripts";
python_directories.push_back(p);
path = PyUnicode_FromString(p.c_str());
PyList_Append(sys_path, path);
Py_DECREF(path);
// Add the path to the ruleset specific code.
p = share_directory + "/cyphesis/rulesets/" + ruleset;
p = share_directory + "/cyphesis/rulesets/" + ruleset + "/scripts";
python_directories.push_back(p);
path = PyUnicode_FromString(p.c_str());
PyList_Append(sys_path, path);