Bug 499016

Summary: ipa host-mod: modifying platform modifies os
Product: [Retired] freeIPA Reporter: Jenny Severance <jgalipea>
Component: ipa-admintoolsAssignee: Dmitri Pal <dpal>
Status: CLOSED UPSTREAM QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.0CC: benl, dpal, jgalipea, mgregg, rcritten
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-28 09:28:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 431020    

Description Jenny Severance 2009-05-04 19:52:36 UTC
Description of problem:
If you modify a host's platform, it also modifies the host's os.

Change host's os to Fedora 11
[root@jennyv2 schema]# ipa host-mod --os="Fedora 11" jennyv4.bos.redhat.com
Host updated

Show the host
[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: Fedora 11

Modify the host's platform to i386
[root@jennyv2 schema]# ipa host-mod --platform="i386" jennyv4.bos.redhat.com
Host updated
[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i386
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga

Not the nsosversion is now "redhat 5.3 Tikanga"


Version-Release number of selected component (if applicable):
2.0



How reproducible:
always

Steps to Reproduce:
1. ipa host-add jennyv4.bos.redhat.com
2. ipa host-show jennyv4.bos.redhat.com
3. ipa host-mod --os="Fedora 11" jennyv4.bos.redhat.com
4. ipa host-show jennyv4.bos.redhat.com
5  ipa host-mod --platform="i386"
6. ipa host-show jennyv4.bos.redhat.com
  
Actual results:
nsosversion is changed to "redhat 5.3 Tikanga"

Expected results:
nsosversion to be "Fedora 11"

Additional info:

Comment 1 Rob Crittenden 2009-05-04 20:05:42 UTC
My guess is that we are auto-filling arguments not passed on mod operations too which is causing the other values to change. I''d guess that you could duplicate this with the other os/platform attributes as well.

Jason, what do you think about this? The variables are defined with autofill and a default set:

        Str('nshardwareplatform?',
            cli_name='platform',
            doc='Hardware platform of this host (e.g. Lenovo T61)',
            default=determine_platform(),
            autofill=True,
        )

It would seem we don't want autofill or a default anyway since there is no guarantee that the host is being added on the actual physical host, causing incorrect data to be set. So it seems to me that the most expedient solution is to simply remove the default and autofill properties.

Comment 2 Jenny Severance 2009-05-04 20:09:13 UTC
It looks like modifying anything - modifies the platform and OS
[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i389
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga


[root@jennyv2 schema]# ipa host-mod --os="Fedora 11" jennyv4.bos.redhat.com
Host updated

[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: Fedora 11

NOTE:  platform was not modified - but it was changed.

[root@jennyv2 schema]# ipa host-mod --description="this is a very interesting
description" jennyv4.bos.redhat.com
Host updated

[root@jennyv2 schema]# ipa host-show jennyv4.bos.redhat.com
  cn: jennyv4.bos.redhat.com
  description: this is a very interesting description
  localityname: Mountain View, CA
  nshardwareplatform: i686
  nshostlocation: IDM Westford lab 3
  nsosversion: redhat 5.3 Tikanga

Comment 3 Pavel Zuna 2009-05-28 14:46:33 UTC
This is fixed in a recent patch. Parameters are cloned with autofill=False in *-mod operations.