prevent exception when test=True

This commit is contained in:
nicholasmhughes 2017-09-25 10:39:11 -04:00
parent a81d4b8d8d
commit 1c484f6ad5

View File

@ -368,7 +368,7 @@ class _Ini(_Section):
super(_Ini, self).__init__(name, inicontents, separator, commenter)
def refresh(self, inicontents=None):
if inicontents is None:
if inicontents is None and __opts__['test'] is False:
try:
with salt.utils.fopen(self.name) as rfh:
inicontents = rfh.read()