Skip to content

Comments

operations/files.block: correct behaviour when markers/block not found and no line provided#1419

Merged
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
morrison12:issue-1416
Sep 16, 2025
Merged

operations/files.block: correct behaviour when markers/block not found and no line provided#1419
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
morrison12:issue-1416

Conversation

@morrison12
Copy link
Contributor

fixes #1416 so that if we're adding at the end of a file it is done correctly.
Added note in the documentation about default umask being used when files creatd
Also correct mode and owner preservation and suppressing backups when the file does not exist.
Apologies for multiple fixes in one PR.

  • [ x ] Pull request is based on the default branch (3.x at this time)
  • [ x ] Pull request includes tests for any new/updated operations/facts
  • [ x ] Pull request includes documentation for any new/updated operations/facts
  • [ x ] Tests pass (see scripts/dev-test.sh)
  • [ x ] Type checking & code style passes (see scripts/dev-lint.sh)

@morrison12 morrison12 changed the title files/block: correct behaviour when markers/block not found and no line operations/files.block: correct behaviour when markers/block not found and no line provided Aug 7, 2025
Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Really nice, thank you @morrison12!

…ne (so adding at start or end of file). Also correct mode and owner preservation
@Fizzadar Fizzadar merged commit b8da502 into pyinfra-dev:3.x Sep 16, 2025
116 of 134 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

files.block doesn't correctly prepend a block when it should

2 participants