diff --git a/pyanaconda/modules/runtime/user_interface/ui.py b/pyanaconda/modules/runtime/user_interface/ui.py index 1a04f157282..5fc4738f1f8 100644 --- a/pyanaconda/modules/runtime/user_interface/ui.py +++ b/pyanaconda/modules/runtime/user_interface/ui.py @@ -74,3 +74,16 @@ def get_default_password_policies(self): PASSWORD_POLICY_USER: PasswordPolicy.from_defaults(PASSWORD_POLICY_USER), PASSWORD_POLICY_LUKS: PasswordPolicy.from_defaults(PASSWORD_POLICY_LUKS), } + + @property + def is_final(self): + """Does the installation environment declare itself as "final"? + + This is false for Rawhide and Beta, true for GA/Gold. + + FIXME: This is a temporary getter. Replace it by the intended product API + + :return bool: final or not + """ + from pyanaconda import product + return product.isFinal diff --git a/pyanaconda/modules/runtime/user_interface/ui_interface.py b/pyanaconda/modules/runtime/user_interface/ui_interface.py index f854fe585fe..c21185b1d94 100644 --- a/pyanaconda/modules/runtime/user_interface/ui_interface.py +++ b/pyanaconda/modules/runtime/user_interface/ui_interface.py @@ -60,3 +60,11 @@ def PasswordPolicies(self, policies: Dict[Str, Structure]): self.implementation.set_password_policies( PasswordPolicy.from_structure_dict(policies) ) + + @property + def IsFinal(self) -> Bool: + """Does the installation environment declare itself as "final"? + + FIXME: This is a temporary getter. Replace it by the intended product API + """ + return self.implementation.is_final diff --git a/pyanaconda/product.py b/pyanaconda/product.py index b5e97d7ddcb..53ed71ba624 100644 --- a/pyanaconda/product.py +++ b/pyanaconda/product.py @@ -22,6 +22,15 @@ from pyanaconda.core.i18n import _ +__all__ = ["isFinal", "productName", "productVersion", "distributionText"] + +# Order of precedence for the variables published in __all__ is: +# 1) Buildstamp file specified by the PRODBUILDPATH environment variable +# 2) Buildstamp file /.buildstamp +# 3) Environment variable ANACONDA_ISFINAL +# 4) In absence of any data, fall back to "false" + + # First, load in the defaults. In order of precedence: contents of # .buildstamp, environment, stupid last ditch hardcoded defaults. config = configparser.ConfigParser()