-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(libtofs
): use select
to deal with empty strings in path
#124
Conversation
* To prevent path breakage when any of the following settings are used in the pillar/config: ``` tofs: path_prefix: '' dirs: files: '' default: '' ```
Refactor: same resultsNo changes introduced when dealing with expected pillar/config configurations. Commented out tofs:
# path_prefix: ''
# dirs:
# files: ''
# default: '' Existing: - source:
- salt://nginx/files/ABC/server.conf
- salt://nginx/files/Debian/server.conf
- salt://nginx/files/default/server.conf New: - source:
- salt://nginx/files/ABC/server.conf
- salt://nginx/files/Debian/server.conf
- salt://nginx/files/default/server.conf Using
|
Fix: blank
|
Fix: blank
|
Fix: blank
|
Fix: everything blankBroken path with existing configuration. Pillar/config tofs:
path_prefix: ''
dirs:
files: ''
default: '' Existing: - source:
- salt:////ABC/server.conf
- salt:////Debian/server.conf
- salt://///server.conf New: - source:
- salt://ABC/server.conf
- salt://Debian/server.conf
- salt://server.conf Diff: - - salt:////ABC/server.conf
- - salt:////Debian/server.conf
- - salt://///server.conf
+ - salt://ABC/server.conf
+ - salt://Debian/server.conf
+ - salt://server.conf |
And now... enter in the formulas update hell 😄 |
Maybe it could be solved by a script launched by someone?
The script could reside in template-formula repo with a yaml file to store repos list (tofs, semantic-release) |
Thanks for the review @n-rodriguez -- and the comment at the very top! |
@n-rodriguez I hit the send button prematurely there (hit |
@n-rodriguez I decided to edit my examples to provide a clearer |
@myii awesome! |
@baby-gnu Maybe selecting you for a review doesn't ping you properly, so I'm trying again with this comment! You are ideally placed to judge if this is a useful PR or not. If it is, we can use some of the strategies laid out above to propagate the changes to all of the other formulas using |
Actually, if this is agreed upon, should the document be updated to include some of these examples? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the src_file.lstrip('/')
, I'm fine with this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to strip /
from all path components.
Thanks for the review @baby-gnu. |
I've gone ahead and merged this, since it's needed in some of the TOFS conversion PRs that are in progress right now. Thanks all. |
🎉 This PR is included in version 2.1.18 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
in the pillar/config:
This PR is based on some discussions in our Slack/IRC/Matrix room, where @sticky-note has been looking at how TOFS can be introduced to the
nginx-formula
(leading to saltstack-formulas/nginx-formula#238). The above pillar was set and led to some breakages, which I will cover in subsequent comments in this PR.Edit by @n-rodriguez: the diff is in the double slash
//
before and after. Great job 👍