Skip to content
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

multipath.aug - unable to set "blacklist{ wwid .*}" #564

Closed
martinhoyer opened this issue Jun 7, 2018 · 6 comments
Closed

multipath.aug - unable to set "blacklist{ wwid .*}" #564

martinhoyer opened this issue Jun 7, 2018 · 6 comments

Comments

@martinhoyer
Copy link

martinhoyer commented Jun 7, 2018

The multipath lens is now accepting only asterisk, which works in older versions, but not with newer packages in Fedora for example. Snip from journalctl:
multipath[1205]: Jun 07 11:31:04 | Invalid regular expression "" in multipath.conf. Using "."

I propose a change in line 36, adding another OR, for ".*"
https://github.com/hercules-team/augeas/blob/master/lenses/multipath.aug#L36
from
let wwid = kv "wwid" (Rx.word|"*")
to
let wwid = kv "wwid" (Rx.word|"*"|".*")

@lutter
Copy link
Member

lutter commented Jun 7, 2018

Hi,

thanks for bringing this up. I just did a little checking with multipath 0.7.4 in Fedora 28, and it appears that wwid and devnode in the blacklist accept a ton more crazy stuff. At least, multipath -d -v3 didn't complain about this crazy /etc/multipath.conf:

blacklist_exceptions {
        property "(SCSI_IDENT_|ID_WWN)"
}

blacklist {
        devnode ".*"
        devnode "[a-z]+(0|1):-\+=?'*"
        wwid "([a-z]+|ab?c).*"
        wwid ":+-'"
}

So, should we just allow pretty much anything for wwid and devnode in the blacklist ? Do you know when the change to accept regexps there was introduced in multipath ?

@martinhoyer
Copy link
Author

Hi,

Do you know when the change to accept regexps there was introduced in multipath ?

I believe it was always using regexp, there was just a change in the parser. More info:

@lutter
Copy link
Member

lutter commented Jun 7, 2018

Thanks for the additional detail. I put a slightly broader change into PR #565. Let me know if that works for you or not and I'll merge it.

@martinhoyer
Copy link
Author

Looks good in my colleague testing. I've also done some manual testing and can confirm it fixes this issue. Thank You very much!

What I found, is every time you want to blacklist a wwid using 'set', the existing one gets overwritten. This might not be a desired action if we're blacklisting one wwid at the time. Same behaviour with and without PR #565.
Not sure if this is a real issue, please let me know what you think about it, and if you want me to open a separate issue.

@lutter
Copy link
Member

lutter commented Jun 8, 2018

You can do either. Using the /etc/multipath.conf from tests/root in the augeas sources, you can update an existing one with doing this in augtool (before you do this, do print /files/etc/multipath.conf to see what the tree looks like):

  set /files/etc/multipath.conf/blacklist[2]/wwid newvalue

If there are already multiple wwid nodes, you can pick one out with something like this:

  set /files/etc/multipath.conf/blacklist[2]/wwid[. = 'oldvalue'] newvalue

If there is no wwid with oldvalue, it will just create a new one.

The simplest way to add a new one is

  set /files/etc/multipath.conf/blacklist[2]/wwid[last()+1] newvalue

That will always create a new wwid entry at the end of the blacklist section.

@martinhoyer
Copy link
Author

Thank You very much!
Completely forgot about this, I'm actually using the last()+1 elswhere.

@lutter lutter closed this as completed in ade4581 Jun 10, 2018
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

No branches or pull requests

2 participants