diff options
author | Brian C. Lane <bcl@redhat.com> | 2012-02-09 13:19:43 -0800 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2012-02-10 11:01:30 -0800 |
commit | c0e70ff628cfee0e1bbd3814766ab3dd6200af2d (patch) | |
tree | d5442d6353924d9f9307b85721b609e7cd538ae4 /pyanaconda/installclass.py | |
parent | 9e4015693a7bcea3efc6769b5785d883efb244ad (diff) | |
download | anaconda-c0e70ff628cfee0e1bbd3814766ab3dd6200af2d.tar.gz anaconda-c0e70ff628cfee0e1bbd3814766ab3dd6200af2d.tar.xz anaconda-c0e70ff628cfee0e1bbd3814766ab3dd6200af2d.zip |
Be more verbose about upgrade failures (#735060)
When an installed system cannot be upgraded it may be helpful to know if
it was the product, version or arch that didn't match. This propagates
that info up from productUpgradable so that it can be show to the user.
Diffstat (limited to 'pyanaconda/installclass.py')
-rw-r--r-- | pyanaconda/installclass.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py index f2774dac6..8aea1bb41 100644 --- a/pyanaconda/installclass.py +++ b/pyanaconda/installclass.py @@ -201,6 +201,11 @@ class BaseInstallClass(object): pass def productUpgradable(self, arch, oldprod, oldver): + """ Return a tuple with: + (Upgradable True|False, dict of tests and status) + + The dict has True|False for: product, version, arch tests. + """ def archesEq(a, b): import re @@ -209,7 +214,12 @@ class BaseInstallClass(object): else: return a == b - return self.productMatches(oldprod) and self.versionMatches(oldver) and archesEq(arch, productArch) + result = { "product" : self.productMatches(oldprod), + "version" : self.versionMatches(oldver), + "arch" : archesEq(arch, productArch) + } + + return (all(result.values()), result) def setNetworkOnbootDefault(self, network): pass |