mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
32b2f2e05f
commit
46ea34b4f5
1 changed files with 8 additions and 7 deletions
|
@ -19,6 +19,7 @@ ensure_in_syspath('../../')
|
|||
|
||||
# Import salt libs
|
||||
import integration
|
||||
import salt.utils
|
||||
|
||||
|
||||
class MinionTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
||||
|
@ -35,14 +36,14 @@ class MinionTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
|
||||
config_file_name = 'minion'
|
||||
pid_path = os.path.join(config_dir, '{0}.pid'.format(config_file_name))
|
||||
config = yaml.load(
|
||||
open(self.get_config_file_path(config_file_name), 'r').read()
|
||||
)
|
||||
config['log_file'] = 'file:///tmp/log/LOG_LOCAL3'
|
||||
with salt.utils.fopen(self.get_config_file_path(config_file_name), 'r') as fhr:
|
||||
config = yaml.load(fhr.read())
|
||||
config['log_file'] = 'file:///tmp/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(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_,
|
||||
|
|
Loading…
Add table
Reference in a new issue