Fix failure to detect RHEL 7 flavours

This PR is to resolve #4450