Merge "Use with keyword for opening target file"
This commit is contained in:
@@ -1101,7 +1101,8 @@ class Deploy(command.Command):
|
|||||||
raise exceptions.DeploymentError(msg)
|
raise exceptions.DeploymentError(msg)
|
||||||
|
|
||||||
target = override_file
|
target = override_file
|
||||||
data = open(target, 'r').read()
|
with open(target, 'rb') as fb:
|
||||||
|
data = fb.read()
|
||||||
if not data.strip():
|
if not data.strip():
|
||||||
# since an empty file isn't valid yaml, let's be more specific
|
# since an empty file isn't valid yaml, let's be more specific
|
||||||
msg = (_("hieradata override file (%s) cannot be empty") % target)
|
msg = (_("hieradata override file (%s) cannot be empty") % target)
|
||||||
|
|||||||
Reference in New Issue
Block a user