stratis-cli can verify that it is running against the correct version of stratisd
Closed this issue · 4 comments
Packaging should ensure that stratis-cli is always installed against the correct version of stratisd, but a dynamic check wouldn't hurt.
You only want to check this when actually communicating w/ stratisd. So, stratis --version
does not get on the D-Bus and it shouldn't cause this check to occur.
Also, it is necessary to know what version of stratisd this version of stratis requires. This is not, I think, anywhere in stratis-cli source currently. So, what is the value, how did we find it out, and where do we put it? We put the required version in _data.py
along with the version-related D-Bus introspection data.
There are only two ways to go about this that I can see:
-
Put in an extra method that checks whether the version of stratisd is compatible. This would work and is simple, but likely most users wouldn't use it.
-
Before every stratis-cli action that actually communicates with stratisd check the version and make sure it's compatible. This has the advantage that the user doesn't have to do anything, but is a bit more complex than (1). Also, it adds a single, simple D-Bus property check to every such method. Probably lightweight compared to the method's real task, but still an addition.
I prefer the second approach, but it is more work. Also, it requires somebody to keep the stratisd version information up-to-date in the stratis-cli code base.