Generate schemas dynamically from pieces provided by each object class
This way we benefit from:
* knowing which attributes are used/required by each object class and
subclass
* Having validation function definitions near the class going to use them
Change-Id: I8fd6773c51d19405a585977af4ed72cad2b21db1
diff --git a/src/osmo_gsm_tester/obj/ms_amarisoft.py b/src/osmo_gsm_tester/obj/ms_amarisoft.py
index 6fd80ee..46a92dc 100644
--- a/src/osmo_gsm_tester/obj/ms_amarisoft.py
+++ b/src/osmo_gsm_tester/obj/ms_amarisoft.py
@@ -21,10 +21,17 @@
import pprint
from ..core import log, util, config, template, process, remote
+from ..core import schema
from ..core.event_loop import MainLoop
from .run_node import RunNode
from .ms import MS
+def on_register_schemas():
+ config_schema = {
+ 'license_server_addr': schema.IPV4,
+ }
+ schema.register_config_schema('amarisoft', config_schema)
+
def rf_type_valid(rf_type_str):
return rf_type_str in ('uhd', 'zmq')