Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Qalthos
Copy link
Collaborator

@Qalthos Qalthos commented Jul 10, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures the directory for a target file exists before writing and refactors the initial “create” step in _run_scenarios to separate shared‐data handling.

  • util.py: Add a call to create the parent directory before writing the file.
  • base.py: Simplify the shared_data check, add a nested “create” condition, and update lint ignore.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/molecule/util.py Ensure parent directory exists before writing file content
src/molecule/command/base.py Refactor initial scenario “create” logic and update lint flags
Comments suppressed due to low confidence (1)

src/molecule/command/base.py:214

  • This append should only occur if the subcommand actually ran; indent both this line and the default.results = [] line under the nested if "create" in ... block to avoid appending or clearing results when create wasn’t executed.
            scenarios.results.append({"name": default.name, "results": default.results})

@ssbarnea ssbarnea changed the title Make sure path exist before writing. Make sure path exist before writing Jul 11, 2025
@ssbarnea ssbarnea marked this pull request as draft July 11, 2025 10:51
@Qalthos Qalthos marked this pull request as ready for review July 16, 2025 11:53
@Qalthos Qalthos merged commit 7b4d06a into ansible:main Jul 17, 2025
19 of 21 checks passed
@Qalthos Qalthos deleted the shared branch July 17, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants