Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 21, 2024
1 parent 61eedf7 commit 4a7e8c9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/molecule_plugins/vagrant/modules/vagrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,7 @@ def _conf_instance(self, instance_name):
try:
return self._vagrant.conf(vm_name=instance_name)
except Exception:
msg = "Failed to get vagrant config for {}: See log file '{}'".format(
instance_name,
self._get_stderr_log(),
)
msg = f"Failed to get vagrant config for {instance_name}: See log file '{self._get_stderr_log()}'"
with open(self._get_stderr_log(), encoding="utf-8") as f:
self.result["stderr"] = f.read()
self._module.fail_json(msg=msg, **self.result)
Expand All @@ -512,10 +509,7 @@ def _status_instance(self, instance_name):

return {"name": s.name, "state": s.state, "provider": s.provider}
except Exception:
msg = "Failed to get status for {}: See log file '{}'".format(
instance_name,
self._get_stderr_log(),
)
msg = f"Failed to get status for {instance_name}: See log file '{self._get_stderr_log()}'"
with open(self._get_stderr_log(), encoding="utf-8") as f:
self.result["stderr"] = f.read()
self._module.fail_json(msg=msg, **self.result)
Expand Down

0 comments on commit 4a7e8c9

Please sign in to comment.