Skip to content

Commit d301d8c

Browse files
committed
The return value of __virtual__ should never be None
1 parent 4b3135b commit d301d8c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

salt/modules/sysrc.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
'''
33
sysrc module for FreeBSD
44
'''
5+
6+
# Import Python libs
57
from __future__ import absolute_import
68

9+
# Import Salt libs
710
import salt.utils
811
from salt.exceptions import CommandExecutionError
912

1013

14+
__virtualname__ = 'sysrc'
15+
1116
__func_alias__ = {
1217
'set_': 'set'
1318
}
@@ -17,7 +22,9 @@ def __virtual__():
1722
'''
1823
Only runs if sysrc exists
1924
'''
20-
return salt.utils.which_bin('sysrc')
25+
if salt.utils.which_bin('sysrc') is not None:
26+
return True
27+
return False
2128

2229

2330
def get(**kwargs):

0 commit comments

Comments
 (0)