Skip to content

Commit

Permalink
Fixed that get_central_instances() continues on CIM_ERR_METHOD_NOT_FO…
Browse files Browse the repository at this point in the history
…UND.

Details:

- In the `WBEMServer.get_central_instances()` method, fixed the error that a
  CIM status code of CIM_ERR_METHOD_NOT_FOUND returned when attempting to
  invoke the GetCentralInstances CIM method lead to failing the
  `get_central_instances()` method. Now, execution continues with attempting
  the next approach for determining the central instances.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Mar 29, 2018
1 parent 71646a5 commit f6d4efa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,12 @@ Bug fixes
significant digits required by DSP0201: 11 for real32, and 17 for real64.
(Issue #1136).

* In the `WBEMServer.get_central_instances()` method, fixed the error that a
CIM status code of CIM_ERR_METHOD_NOT_FOUND returned when attempting to
invoke the GetCentralInstances CIM method lead to failing the
`get_central_instances()` method. Now, execution continues with attempting
the next approach for determining the central instances (Issue #1145).

Cleanup
^^^^^^^

Expand Down
6 changes: 4 additions & 2 deletions pywbem/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def explore_server(server_url, username, password):
import re

from .cim_constants import CIM_ERR_INVALID_NAMESPACE, CIM_ERR_INVALID_CLASS, \
CIM_ERR_METHOD_NOT_AVAILABLE, CIM_ERR_NOT_SUPPORTED, CIM_ERR_NOT_FOUND
CIM_ERR_METHOD_NOT_FOUND, CIM_ERR_METHOD_NOT_AVAILABLE, \
CIM_ERR_NOT_SUPPORTED, CIM_ERR_NOT_FOUND
from .exceptions import CIMError
from .cim_obj import CIMInstanceName, NocaseDict
from .cim_operations import WBEMConnection
Expand Down Expand Up @@ -449,7 +450,8 @@ def get_central_instances(self, profile_path, central_class=None,
MethodName="GetCentralInstances",
ObjectName=profile_path)
except CIMError as exc:
if exc.status_code in (CIM_ERR_METHOD_NOT_AVAILABLE,
if exc.status_code in (CIM_ERR_METHOD_NOT_FOUND,
CIM_ERR_METHOD_NOT_AVAILABLE,
CIM_ERR_NOT_SUPPORTED):
# Method is not implemented.
# CIM_ERR_NOT_SUPPORTED is not an official status code for this
Expand Down

0 comments on commit f6d4efa

Please sign in to comment.