mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
70b657af20
commit
d27c38d28f
@ -19,6 +19,7 @@ ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
import integration
|
||||
import salt.utils
|
||||
|
||||
|
||||
class SyndicTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
@ -35,16 +36,16 @@ class SyndicTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
|
||||
for fname in ('master', 'minion'):
|
||||
pid_path = os.path.join(config_dir, '{0}.pid'.format(fname))
|
||||
config = yaml.load(
|
||||
open(self.get_config_file_path(fname), 'r').read()
|
||||
)
|
||||
with salt.utils.fopen(self.get_config_file_path(fname), 'r') as fhr:
|
||||
config = yaml.load(fhr.read())
|
||||
config['log_file'] = config['syndic_log_file'] = 'file:///tmp/log/LOG_LOCAL3'
|
||||
config['root_dir'] = config_dir
|
||||
if 'ret_port' in config:
|
||||
config['ret_port'] = int(config['ret_port']) + 10
|
||||
config['publish_port'] = int(config['publish_port']) + 10
|
||||
|
||||
open(os.path.join(config_dir, fname), 'w').write(
|
||||
with salt.utils.fopen(os.path.join(config_dir, fname), 'w') as fhw:
|
||||
fhw.write(
|
||||
yaml.dump(config, default_flow_style=False)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user