Bug 499016 - ipa host-mod: modifying platform modifies os
Summary: ipa host-mod: modifying platform modifies os
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: freeIPA
Classification: Retired
Component: ipa-admintools
Version: 2.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dmitri Pal
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: 431020
TreeView+ depends on / blocked
 
Reported: 2009-05-04 19:52 UTC by Jenny Severance
Modified: 2015-01-04 23:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-28 09:28:50 UTC
Embargoed:


Attachments (Terms of Use)

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.


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