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] authored and audgirka committed Jan 3, 2025
1 parent 2f09dbb commit 1e7182d
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 @@ -499,10 +499,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 @@ -513,10 +510,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 1e7182d

Please sign in to comment.