Bug 499016 - ipa host-mod: modifying platform modifies os
ipa host-mod: modifying platform modifies os
Status: CLOSED UPSTREAM
Product: freeIPA
Classification: Community
Component: ipa-admintools (Show other bugs)
2.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dmitri Pal
Chandrasekar Kannan
:
Depends On:
Blocks: 431020
  Show dependency treegraph
 
Reported: 2009-05-04 15:52 EDT by Jenny Galipeau
Modified: 2015-01-04 18:38 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-28 05:28:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jenny Galipeau 2009-05-04 15:52:36 EDT
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 16:05:42 EDT
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 Galipeau 2009-05-04 16:09:13 EDT
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 10:46:33 EDT
This is fixed in a recent patch. Parameters are cloned with autofill=False in *-mod operations.

Note You need to log in before you can comment on or make changes to this bug.