[PATCH 6/6] Identify Atomic install class by correct product name (#1193268)

Radek Vykydal rvykydal at redhat.com
Tue Jun 2 08:32:44 UTC 2015


On 06/01/2015 07:59 PM, Brian C. Lane wrote:
> On Mon, Jun 01, 2015 at 05:47:44PM +0200, Radek Vykydal wrote:
>> Resolves: rhbz#1193268
>> ---
>>   pyanaconda/installclasses/rhel.py | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
>> index e0a4cd9..e340b62 100644
>> --- a/pyanaconda/installclasses/rhel.py
>> +++ b/pyanaconda/installclasses/rhel.py
>> @@ -71,8 +71,9 @@ class RHELBaseInstallClass(BaseInstallClass):
>>           BaseInstallClass.__init__(self)
>>   
>>   class RHELAtomicInstallClass(RHELBaseInstallClass):
>> -    name = "RHEL Atomic Host"
>> -    if productName.startswith("RHEL Atomic"):
>> +    name = "Red Hat Enterprise Linux Atomic Host"
>> +    sortPriority=21000
>> +    if productName.startswith(("RHEL Atomic Host", "Red Hat Enterprise Linux Atomic")):
>>           hidden = False
>>   
>>       def setDefaultPartitioning(self, storage):
>> -- 
>> 1.9.3
> I think RHELBaseInstallClass also needs a change. It is now going
> to catch the Atomic product as well, since it only looks for 'Red Hat '
> it probably needs to explicitly exclude other known products that
> overlap with it.
>

That is why I set the sortPriority higher (21000) then for 
RHELBaseInstallClass (ie RHEL[1]). I like it better than explicitly 
excluding in RHELBaseInstallClass something defined in its subclass. 
Also having the string on another place (base class) is an opportunity 
for not handling both occurrences of the string in future patches.

[1]
And I've just noticed that in rhel7.0-branch we have sortPriority 20000 
while in rhel7-branch (f21) 10000. Not sure if it may cause any problems 
though.


More information about the anaconda-patches mailing list