salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

Epel repo regular expression incorrect syntax

Open kondotak opened this issue 5 years ago • 5 comments

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

image

image

kondotak avatar Sep 09 '19 01:09 kondotak

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.

stale[bot] avatar Mar 09 '20 02:03 stale[bot]

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 ?

vutny avatar Mar 10 '20 11:03 vutny

Thank you for updating this issue. It is no longer marked as stale.

stale[bot] avatar Mar 10 '20 11:03 stale[bot]

I marked this Info Needed since we need to know what the correct behavior is and if @kondotak is willing to open a pr.

bryceml avatar Jul 15 '20 00:07 bryceml

I encountered the same problem (trying to work around a different issue).

+ yum repolist
+ grep -q '^[!]\?base/'

noelmcloughlin avatar Dec 29 '20 13:12 noelmcloughlin