[SOLVED for me] Unable to use productDependency_delete nor deleteProductDependency

Antworten
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

[SOLVED for me] Unable to use productDependency_delete nor deleteProductDependency

Beitrag von nicolaslebrun »

In "opsi-admin -dic", i'm trying to delete a productDependency

I tried

Code: Alles auswählen

root@opsi-admin> method productDependency_delete "opsi--meta-auto" "3.8.8.0" "36" "setup" "opsi-regressi"
with no visible error

and

Code: Alles auswählen

root@opsi-admin> method deleteProductDependency "opsi--meta-auto" "setup" "opsi-regressi" "" "before" []                                                                                                                                     
ERROR: Failed to execute u'method deleteProductDependency "opsi--meta-auto" "setup" "opsi-regressi" "" "before" []': productDependency_delete() got an unexpected keyword argument 'requirementType'       
In both cases, when looking at dependencies, i still have the dependency.

Code: Alles auswählen

root@opsi-admin> method getProductDependencies_listOfHashes opsi--meta-auto

...
  },                                                                                                                                                                                                                                       
    {                                                                                                                                                                                                                                        
    "requiredInstallationStatus" : "installed",                                                                                                                                                                                              
    "requirementType" : "before",                                                                                                                                                                                                            
    "requiredProductId" : "opsi-regressi",                                                                                                                                                                                                   
    "requiredAction" : "",                                                                                                                                                                                                                   
    "action" : "setup",                                                                                                                                                                                                                      
    "requiredProductClassId" : "",                                                                                                                                                                                                           
    "productId" : "opsi--meta-auto"                                                                                                                                                                                                          
    }                                                                                                                                                                                                                                        
]                
What am i missing ?

Regards,

Nicolas Lebrun
Zuletzt geändert von nicolaslebrun am 31 Mär 2017, 13:49, insgesamt 1-mal geändert.
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

Re: Unable to use productDependency_delete nor

Beitrag von nicolaslebrun »

But this one seems to work...

Code: Alles auswählen

root@opsi-admin> method productDependency_deleteObjects '{"ident" : "opsi--meta-auto;1.0;1;setup;opsi-regressi","type" : "ProductDependency"}'
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Unable to use productDependency_delete nor

Beitrag von n.wenselowski »

Hi Nicolas Lebrun,
nicolaslebrun hat geschrieben:

Code: Alles auswählen

root@opsi-admin> method deleteProductDependency "opsi--meta-auto" "setup" "opsi-regressi" "" "before" []                                                                                                                                     
ERROR: Failed to execute u'method deleteProductDependency "opsi--meta-auto" "setup" "opsi-regressi" "" "before" []': productDependency_delete() got an unexpected keyword argument 'requirementType'       
This is a bug and will probably be fixed in python-opsi 4.0.7.38.
nicolaslebrun hat geschrieben:But this one seems to work...

Code: Alles auswählen

root@opsi-admin> method productDependency_deleteObjects '{"ident" : "opsi--meta-auto;1.0;1;setup;opsi-regressi","type" : "ProductDependency"}'
This would be the way I'd recommend you to use.
As a tip I'd get myself the full dep by running productDepedency_getObjects + filters and then use this. This is preferred to relying on the ident (a combination of all the keys for an object).


Kind regards

Niko

Code: Alles auswählen

import OPSI
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

Re: [SOLVED for me] Unable to use productDependency_delete nor deleteProductDependency

Beitrag von nicolaslebrun »

Thank's Niko for your answer !
Antworten