-
Notifications
You must be signed in to change notification settings - Fork 495
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
(FACT-1712) Improve zpool_version fact resolution #1597
Conversation
08a4900
to
e93af7b
Compare
CLA signed by all contributors. |
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.
This does now seem to match the Ruby implementation.
For information, here is the output of
I guess the main difference is that my system has features flags support, and maybe reporting them in facter would make sense (i.e. According to
So, maybe it would make sense to change |
In general we try not to change the types of fact values, except on major version boundaries. However, I also don't have a good understanding of how this fact might be used in the real world. @MikaelSmith or @branan, thoughts on the utility vs. surprising results of the above suggestion? |
We specify |
@smortex so whatever information you think would be the most useful to the user, go ahead and update this to report that. Thanks for providing that perspective! |
ZFS and zpool versions are called "features" internaly, which will lead us to a lot of confusion with newer versions of zpool havind a new concept of feature flags. Rename all these variables to prevent such confusion, but do not change the fact names (zfs_featurenumbers, zpool_featurenumbers) for now to avoid breaking thigs.
Extend zpool facts with feature flags on supported systems. If feature flags are enabled, make the zpool_version flag return "1000" as per [2]. References: 1. http://www.open-zfs.org/wiki/Feature_Flags 2. http://web.archive.org/web/20160419064650/http://blog.delphix.com/csiden/files/2012/01/ZFS_Feature_Flags.pdf
e93af7b
to
b67d888
Compare
Hi @Magisus! Just found this presentation where feature flags are reported to correspond to legacy zfs version 1000, so I dropped my previous commit and with the pushed changes, I took the liberty to rename a bunch of variables related to ZFS / zpool versions that where named features in a first commit to make the changes more easy to read. The second commit actually add the new Here is what is reported on my system:
|
// Get the zpool version and features | ||
static boost::regex zpool_version("ZFS pool version (\\d+)[.]"); | ||
static boost::regex zpool_feature("^\\s*(\\d+)[ ]"); | ||
static boost::regex zpool_version("^This system is currently running ZFS pool version (\\d+)\\.$"); |
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.
Are these messages affected by the user's locale, or are they always in English?
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.
On FreeBSD, they are currently not localized. BTW, it looks like leatherman sets LC_ALL=C
in the command environment, so this should not be an issue.
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.
Perfect, thanks.
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.
Thanks for researching this and helping to make this fact more meaningful!
Feature flags is actually version 5000, not 1000. |
This allows facter-ng to retun the same facts as facter 3.x. This changes took place in Facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597
…443) * (FACT-2564) Add support for zpool_featureflags and fix zpool_version This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597 * (FACT-2564) Move zpool feature flags in a let statement Co-authored-by: Bogdan Irimie <bogdan.irimie@puppet.com>
…443) * (FACT-2564) Add support for zpool_featureflags and fix zpool_version This allows facter-ng to return the same facts as facter 3.x. This changes took place in facter 3.8.0: puppetlabs/facter#1597 * (FACT-2564) Move zpool feature flags in a let statement Co-authored-by: Bogdan Irimie <bogdan.irimie@puppet.com>
When
zpool upgrade -v
does not output 'ZFS pool version XXX.',fall-back to the last version reported.
This mimics the behavior of the Ruby version of Facter and makes the
fact reported when feature flags are enabled.