intel / NMPRK

3 stars 10 forks source link

we can do delPolicy() many times without setPolicy #12

Closed yilongx closed 12 years ago

yilongx commented 12 years ago

I test this case using following steps:

1 initial Lib and Device 2 involve setPolicyStatus() 3 involve delPolicy 4 uninitial Device and Lib 5 build this test file 6 run many time

jrmassoni commented 12 years ago

The design is to allow delPolicy to be called many times without a setPolicy. In cases where there is no policy to delete it should do nothing. If the policy exists it should delete it.

jrmassoni commented 12 years ago

Proposed change is to return 0x80 the IPMI return code if the Policy ID is invalid (the policy to be deleted is not found). If the policy is not found, then it returns an exception. There you can search for 0x80 to see if the policy existed. This will also be the same for getPolicy. You would first do a getPolicy, if the policy is found you could do a delPolicy. If getPolicy or delPolicy do not find the policy they will return 0x80 in the exception e->errorCode to see if the policy was found.

yilongx commented 12 years ago

fixed and verified