add check_frozen in slave
authorEmmanuel Garette <egarette@cadoles.com>
Sat, 6 May 2017 17:54:20 +0000 (19:54 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Sat, 6 May 2017 17:54:20 +0000 (19:54 +0200)
test/test_mandatory.py
tiramisu/option/masterslave.py

index 639b449..f90b049 100644 (file)
@@ -549,6 +549,15 @@ def test_mandatory_master_empty():
     config.read_only()
     assert config.ip_admin_eth0.ip_admin_eth0 == ['ip']
     assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
+    #
+    config.read_write()
+    config.ip_admin_eth0.netmask_admin_eth0 = ['ip2']
+    config.read_only()
+    raises(PropertiesOptionError, "del(config.ip_admin_eth0.netmask_admin_eth0)")
+    raises(PropertiesOptionError, "del(config.ip_admin_eth0.ip_admin_eth0)")
+    config.read_write()
+    del(config.ip_admin_eth0.netmask_admin_eth0)
+    del(config.ip_admin_eth0.ip_admin_eth0)
     try:
         delete_session('config', 'man106')
     except ValueError:
index ac038ea..847d644 100644 (file)
@@ -193,7 +193,7 @@ class MasterSlaves(object):
         #if masterlen == 0:
         if validate_properties:
             props = context.cfgimpl_get_settings().validate_properties(opt, False,
-                                                                       False,
+                                                                       check_frozen,
                                                                        value=multi,
                                                                        path=path,
                                                                        force_permissive=force_permissive,