1
0
Fork 0

plugin_sysctl: pass verification even if the option doesn't exist

In case sysctl option doesn't exist (e.g. is unsupported on the
system), the verification now passes.

Related: rhbz#1252153

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2015-11-16 18:22:28 +01:00
parent cb826c1e38
commit d49469f711

View file

@ -51,8 +51,12 @@ class SysctlPlugin(base.Plugin):
ret = True
for option, value in instance._sysctl.iteritems():
curr_val = self._read_sysctl(option)
if self._verify_value(option, self._cmd.remove_ws(self._variables.expand(value)), curr_val) == False:
ret = False
if curr_val is None:
log.warn("verify: option '%s' is None, option is probably unavailable/unsupported on your system, skipping it",
str(option))
else:
if self._verify_value(option, self._cmd.remove_ws(self._variables.expand(value)), curr_val) == False:
ret = False
return ret
def _instance_unapply_static(self, instance, profile_switch = False):