mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
9f60901597
commit
2d210b9055
@ -12,6 +12,7 @@ ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
import integration
|
||||
import salt.utils
|
||||
|
||||
|
||||
class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
@ -248,13 +249,15 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
os.chdir(config_dir)
|
||||
|
||||
config_file_name = 'master'
|
||||
config = yaml.load(
|
||||
open(self.get_config_file_path(config_file_name), 'r').read()
|
||||
)
|
||||
config['log_file'] = 'file:///dev/log/LOG_LOCAL3'
|
||||
open(os.path.join(config_dir, config_file_name), 'w').write(
|
||||
yaml.dump(config, default_flow_style=False)
|
||||
)
|
||||
with salt.utils.fopen(self.get_config_file_path(config_file_name), 'r') as fhr:
|
||||
config = yaml.load(
|
||||
fhr.read()
|
||||
)
|
||||
config['log_file'] = 'file:///dev/log/LOG_LOCAL3'
|
||||
with salt.utils.fopen(os.path.join(config_dir, config_file_name), 'w') as fhw:
|
||||
fhw.write(
|
||||
yaml.dump(config, default_flow_style=False)
|
||||
)
|
||||
ret = self.run_script(
|
||||
self._call_binary_,
|
||||
'--config-dir {0} minion test.ping'.format(
|
||||
|
Loading…
Reference in New Issue
Block a user