phatina/python-lmiwbem

[RFE] Request for slight change in createInstance signature

Closed this issue · 4 comments

Currently lmiwbem takes an instance whose path is filled manually as illustarted below for createInstance. A user has to manually filled those values,which are extraneous.
To be more compatible with other client like pywbem and pegasus CIM Client.

Will it be possible to change create instance to accept CIMInstance without requiring path set and asking user to set namespace. if the user does not supply the namespace assumed the default one.
This is lighten the task a bit on users and migrating code from pywbem and also simplify lmiwbem code.

member_of_group = lmiwbem.CIMInstance(
"LMI_MemberOfGroup",
lmiwbem.NocaseDict({
"Member" : identity_iname,
"Collection" : group_iname}),

No qualifiers

None,
lmiwbem.CIMInstanceName(
"LMI_MemberOfGroup",
# No keybindings; Member and Collection are not key properties in
# LMI_MemberOfGroup
None,
hostname,
"root/cimv2"))

new_iname = conn.CreateInstance(member_of_group)

Sure, let me have a look at this.

Ok, Now We have a fix which you might like to review. I am learning my way around git. Will be up for your review after sometime.

Pull request is up for review

Closing with commit a8e1c18