Switch open() for salt.utils.fopen()

This commit is contained in:
Pedro Algarvio 2014-11-26 18:52:54 +00:00
parent d447ceadef
commit f7d9c81789

View File

@ -7,6 +7,9 @@ The service module for OpenBSD
import os
import logging
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
# XXX enable/disable support would be nice
@ -127,7 +130,7 @@ def _get_rc():
try:
# now read the system startup script /etc/rc
# to know what are the system enabled daemons
with open('/etc/rc', 'r') as handle:
with salt.utils.fopen('/etc/rc', 'r') as handle:
lines = handle.readlines()
except IOError:
log.error('Unable to read /etc/rc')