Fixes #5661 Handle null values for sysctl parameters

reviewable/pr18780/r1
James Tanner 11 years ago
parent 49b0db9819
commit f3b86abc30

@ -120,7 +120,10 @@ class SysctlModule(object):
# Whitespace is bad # Whitespace is bad
self.args['name'] = self.args['name'].strip() self.args['name'] = self.args['name'].strip()
if self.args['value'] is not None:
self.args['value'] = self.args['value'].strip() self.args['value'] = self.args['value'].strip()
else:
self.args['value'] = ""
thisname = self.args['name'] thisname = self.args['name']
@ -169,7 +172,7 @@ class SysctlModule(object):
if rc != 0: if rc != 0:
return None return None
else: else:
return shlex.split(out)[-1] return out
# Use the sysctl command to set the current value # Use the sysctl command to set the current value
def set_token_value(self, token, value): def set_token_value(self, token, value):

Loading…
Cancel
Save