salt-bootstrap
salt-bootstrap copied to clipboard
Epel repo regular expression incorrect syntax
Line 3675: if yum repolist | grep -q "^[!]\?${_EPEL_REPO}/"; then
The regular expression "^[!]\?${_EPEL_REPO}/" will never find a match because it has an extra slash at the end. I removed slash on the salt master's bootstrap-salt.sh that it copies over to minion when using salt-cloud to create minion and it now successfully finds the alternate repo specified in the env_var BS_EPEL_REPO
suggest:
change: if yum repolist | grep -q "^[!]\?${_EPEL_REPO}/"; then
to: if yum repolist | grep -q "^[!]\?${_EPEL_REPO}"; then
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
That extra slash was added for some parsing safety because previously yum repolist
command showed EPEL repo entries with arch suffix like this:
epel/x86-64
To be on a safe side, the trailing slash could be substituted with \W
expression (non-alphanumeric character).
Would you mind to submit a PR, @kondotak ?
Thank you for updating this issue. It is no longer marked as stale.
I marked this Info Needed since we need to know what the correct behavior is and if @kondotak is willing to open a pr.
I encountered the same problem (trying to work around a different issue).
+ yum repolist
+ grep -q '^[!]\?base/'