mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
d447ceadef
commit
f7d9c81789
@ -7,6 +7,9 @@ The service module for OpenBSD
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
# Import Salt libs
|
||||||
|
import salt.utils
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
# XXX enable/disable support would be nice
|
# XXX enable/disable support would be nice
|
||||||
@ -127,7 +130,7 @@ def _get_rc():
|
|||||||
try:
|
try:
|
||||||
# now read the system startup script /etc/rc
|
# now read the system startup script /etc/rc
|
||||||
# to know what are the system enabled daemons
|
# 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()
|
lines = handle.readlines()
|
||||||
except IOError:
|
except IOError:
|
||||||
log.error('Unable to read /etc/rc')
|
log.error('Unable to read /etc/rc')
|
||||||
|
Loading…
Reference in New Issue
Block a user