Dan Smith wrote:
GY> + cmd = "lsof -P -i:5988 | grep sfcbd"
GY> + rc, out = utils.run_remote(options.ip, cmd)
GY> + if rc == 0:
GY> + cim_desc = "The requested operation is not supported"
GY> + else:
GY> + cim_desc = "CIM_ERR_NOT_SUPPORTED"
-1.
Just have a list of the two valid error codes and check that it's one of
the two:
msgs = ["The requested operation is not supported",
"CIM_ERR_NOT_SUPPORTED"]
if errmsg not in msgs:
# FAIL
However, it seems to me like this particular case should be handled by
checking the error code. We should fix the return values instead of
this hack.
The providers are returning the proper values for these calls. The
difference between Pegasus and SFCB in this case is that Pegasus returns
"CIM_ERR_NOT_SUPPORTED" as the error description and SFCB returns "The
requested operation is not supported".
Daisy, in this case, the error returned by both is CIM_ERR_NOT_SUPPORTED
(which is equal to 7). Since this error is specific, I think it's fine
to just check the error number. There's no need to check the error
description.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com