Only small idea. What about changing these def type return value to Enum some enum. If you will use this for comparison then you need to find exact string. The Enum could be helpful here thought.
https://github.com/vpodzime/blivet/blob/bdacb4c311b02431090ae2cb999fe7d36623...
I absolutely agree, but that's something we should do across all blivet codebase at once in some followup patch (set).
anaconda-patches@lists.fedorahosted.org