Skip to content

Commit

Permalink
Merge pull request rhinstaller#4931 from VladimirSlavik/master-isfina…
Browse files Browse the repository at this point in the history
…l-modularized-2

Publish isFinal on D-Bus
  • Loading branch information
VladimirSlavik committed Jul 19, 2023
2 parents 135028e + b57b1b1 commit 1f93219
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pyanaconda/modules/runtime/user_interface/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions pyanaconda/modules/runtime/user_interface/ui_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions pyanaconda/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1f93219

Please sign in to comment.