Bug 1021931

Summary: Account provider: cannot create any user with CreateAccount
Product: Red Hat Enterprise Linux 7 Reporter: Petr Sklenar <psklenar>
Component: openlmi-providersAssignee: Tomáš Bžatek <tbzatek>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Sklenar <psklenar>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: jsafrane, rhack, tbzatek, tsmetana
Target Milestone: betaKeywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openlmi-tools-0.9-17.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:35:10 UTC Type: Bug
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: 1022629, 1023467    
Bug Blocks:    

Description Petr Sklenar 2013-10-22 11:00:52 UTC
Description of problem:
I cannot create user

Version-Release number of selected component (if applicable):
latest rhel7, from Oct-18

openlmi-python-base-0.3.0-2.el7.noarch
openlmi-storage-0.6.0-2.el7.noarch
openlmi-service-0.3.0-2.el7.x86_64
openlmi-account-doc-0.3.0-1.el7.noarch
openlmi-providers-0.3.0-2.el7.x86_64
openlmi-python-providers-0.3.0-2.el7.noarch
openlmi-logicalfile-0.3.0-2.el7.x86_64
openlmi-account-0.3.0-2.el7.x86_64
openlmi-tools-0.7-3.el7.noarch
openlmi-powermanagement-0.3.0-2.el7.x86_64
openlmi-fan-0.3.0-2.el7.x86_64
openlmi-networking-debuginfo-0.1.1-3.el7.x86_64
openlmi-storage-doc-0.6.0-2.el7.noarch
openlmi-indicationmanager-libs-0.3.0-2.el7.x86_64
openlmi-software-0.3.0-2.el7.noarch
openlmi-networking-0.2.0-1.el7.x86_64
openlmi-providers-debuginfo-0.3.0-1.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1, see this steps: http://www.openlmi.org/sites/default/files/doc/admin/openlmi-providers/latest/account/usage.html#create-user

>>> cs = conn.root.cimv2.PG_ComputerSystem.first_instance()
>>> lams = conn.root.cimv2.LMI_AccountManagementService.first_instance()
>>> lams.CreateAccount(Name="lmishell-user", System=cs)
LMIReturnValue(rval=-1, rparams={}, errorstr=u"CIM_ERR_FAILED: Unable to create account on the given System\n: 'CreateAccount'")

or:
>>> lams.CreateAccount(Name="lmishell-user")
LMIReturnValue(rval=-1, rparams={}, errorstr=u"CIM_ERR_FAILED: Required parameters not specified\n: 'CreateAccount'")


Actual results:
cannot create user

Expected results:
create user

Additional info:
I tried PG_ComputerSystem or CIM_ComputerSystem with the same results

is docs (link at step 1) updated?

Comment 3 Tomáš Bžatek 2013-10-23 16:17:06 UTC
This is caused by non-matching object paths of active CIM_ComputerSystem instance.

Debugging revealed two problems:
 1. PG_ComputerSystem instance having incorrenctly set CreationClassName="CIM_ComputerSystem" property. This is dependent bug 1022629.
 2. non-matching hostname, i.e. "localhost" vs. "localhost.localdomain"

Comment 4 Tomáš Bžatek 2013-11-01 10:53:38 UTC
(In reply to Petr Sklenar from comment #0)
> >>> cs = conn.root.cimv2.PG_ComputerSystem.first_instance()

You need to use Linux_ComputerSystem for the moment, PG_ComputerSystem is coming soon (bug 1018674).

> is docs (link at step 1) updated?

They're, for upstream, where the change has been already done. I admit this is rather unfortunate.

However, in upstream 0.4.0 release where PG_ComputerSystem was used by default an issue with non-matching hostnames persists. This has been fixed recently upstream by commit https://git.fedorahosted.org/cgit/openlmi-providers.git/commit/?id=49394a84fe1235b692fc32d903bf3486e41f76b4

Marking this bugreport blocked by bug 1023467. I'm going to do more tests to ensure the hostname mismatches are gone.

Comment 5 Jan Safranek 2013-11-01 11:18:40 UTC
This is already done upstream, waiting for release.

Comment 7 Petr Sklenar 2013-11-06 13:29:39 UTC
I still doesnot work for me:
openlmi-tools-0.9-1.el7.noarch
openlmi-account-0.4.1-1.el7.x86_64


>>> import unittest
>>> 
>>> import lmi.shell as lmishell
>>> import os
>>> import shutil
>>> import threading
>>> import string
>>> import random
>>> 
>>> from methods import *
>>> 
>>> HOST =      "localhost"
>>> USER =      os.environ.get("LMI_CIMOM_USERNAME", "root")
>>> PASSWD =    os.environ.get("LMI_CIMOM_PASSWORD", "blank")
>>> conn = lmishell.connect(HOST, USER, PASSWD)
>>> cs = conn.root.cimv2.PG_ComputerSystem.first_instance()
>>> lams = conn.root.cimv2.LMI_AccountManagementService.first_instance()
>>> lams.CreateAccount(Name="lmishell-userqwert", System=cs)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/lmi/shell/LMIMethod.py", line 489, in __call__
    self._method.name, **method_args)
  File "/usr/lib/python2.7/site-packages/lmi/shell/LMIBaseClient.py", line 388, in _call_method_raw
    (rval, rparams) = self._cliconn.InvokeMethod(method, instance.path, **params)
  File "/usr/lib/python2.7/site-packages/pywbem/cim_operations.py", line 800, in InvokeMethod
    result = self.methodcall(MethodName, obj, **params)
  File "/usr/lib/python2.7/site-packages/pywbem/cim_operations.py", line 301, in methodcall
    for x in params.items()]
  File "/usr/lib/python2.7/site-packages/pywbem/cim_operations.py", line 285, in paramvalue
    raise TypeError('Unsupported parameter type "%s"' % type(obj))
TypeError: Unsupported parameter type "<class 'lmi.shell.LMIInstanceName.LMIInstanceName'>"

Comment 8 Petr Sklenar 2013-11-06 13:34:21 UTC
its fixed by:
https://errata.devel.redhat.com/errata/brewfiles.cgi?id=15847

Comment 11 Ludek Smid 2014-06-13 10:35:10 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.