Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

More robust & strict hook deployment #142

Merged
merged 3 commits into from
Sep 15, 2016
Merged

More robust & strict hook deployment #142

merged 3 commits into from
Sep 15, 2016

Conversation

AloisMahdal
Copy link
Collaborator

This solves multiple (not all) issues discussed in last commenrt in rhbz#1334903.

Bash part tested with current downstream build (replaced common.sh, ran test).

Please see individual commits for more details.

Alois Mahdal added 3 commits September 15, 2016 03:53
Quote variable references properly in case "funny" characters make it to
those variables.

Some cases may seem probable, some less, but it's definitely more robust
and consistent to apply quoting everywhere.
Previous version of Bash function ignored all possible cp failures.
Also it created a global variable TO_COPY for no apparent reason.
In Python API, some of these problems are not present or relevant,
but copying errors are still ignored (probably would end up as one
of mild risk cases).

This patch fixes all above problems.  If there's *any* cp error, both
functions will log an error and exit wirh 'error' result.

Additionally, this handles correctly the case when a source file copied
by Bash function starts with dash.
It's not possible to continue with incomplete or missing hook script.
Copy link
Contributor

@phracek phracek left a comment

Choose a reason for hiding this comment

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

Seems fine to me, I will fix python related part.

@phracek phracek merged commit 222b30e into upgrades-migrations:master Sep 15, 2016
@AloisMahdal AloisMahdal deleted the strict_hook_deploy branch September 16, 2016 00:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants