From 3bd99903a487efa29ceaec21eea53eb0e680e842 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Fri, 17 Jan 2014 11:30:07 -0500 Subject: [PATCH] Fixes #5661 Handle null values for sysctl parameters --- library/system/sysctl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/system/sysctl b/library/system/sysctl index 407d36286d..59b92eb6f4 100644 --- a/library/system/sysctl +++ b/library/system/sysctl @@ -120,7 +120,10 @@ class SysctlModule(object): # Whitespace is bad self.args['name'] = self.args['name'].strip() - self.args['value'] = self.args['value'].strip() + if self.args['value'] is not None: + self.args['value'] = self.args['value'].strip() + else: + self.args['value'] = "" thisname = self.args['name'] @@ -169,7 +172,7 @@ class SysctlModule(object): if rc != 0: return None else: - return shlex.split(out)[-1] + return out # Use the sysctl command to set the current value def set_token_value(self, token, value):