Commit Graph

7 Commits

Author SHA1 Message Date
Sean McGinnis 1f2b0ed263
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I1e30d77b7ca98c08ec8c42a18df863b202525418
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-28 07:46:23 -05:00
Christopher Dearborn 0de8b41768 Filter out non-ASCII characters on invalid UTF8
When an enumerate is done, it is possible that the iDRAC may return
invalid UTF8 that contains non-ASCII characters.  This causes an
XMLSyntaxError to be thrown.  This fix detects that situation and
filters out all non-ASCII characters to bypass the error.

See the following bug for further details:
https://bugs.launchpad.net/python-dracclient/+bug/1779412

Closes-Bug: #1779412
Change-Id: I5003785dee922920dcdd95c8d7e2a26e0bf97a7d
2018-07-09 17:40:52 -04:00
Richard Pioso c75969dd8d Parameterize iDRAC is ready retries at class level
Web Services Management (WS-Management and WS-Man) requests/commands can
fail or return invalid results when issued to an integrated Dell Remote
Access Controller (iDRAC) whose Lifecycle Controller remote service is
not "ready". Specifically, that applies to the WS-Man Enumerate and
Invoke operations.

A Dell technical white paper [0], "Lifecycle Controller Integration --
Best Practices Guide", states that for Lifecycle Controller firmware
1.5.0 and later "The Lifecycle Controller remote service must be in a
'ready' state before running any other WSMAN commands." That applies to
almost all of the workflows and use cases documented by that paper and
supported by this project, openstack/python-dracclient. That document
describes how to determine the readiness of the Lifecycle Controller
remote service.

This patch parameterizes the iDRAC is ready retry behavior at the class
level. That makes it possible for consumers of this project, such as
project openstack/ironic, to configure it library API-wide.

Additionally, this patch improves the names of the parameters to class
__init__() methods that control the retry behavior on SSL errors, so
that they are not confused with those added by this patch. Finally, it
defines constants for the default values of the retry behavior on SSL
errors and iDRAC is ready retry parameters, and utilizes those new
constants.

[0]
http://en.community.dell.com/techcenter/extras/m/white_papers/20442332

Change-Id: Ie866466a8ddf587a24c6d25ab903ec7b24022ffd
Partial-Bug: #1697558
Related-Bug: #1691272
Related-Bug: #1691808
2017-07-24 19:29:15 -04:00
Christopher Dearborn d6edaac2a1 Fix immediate failure on SSL errors
This patch adds retry logic to communication with the iDRAC so that
intermittent SSLErrors or ConnectionErrrors will not cause an immediate
failure of the operation.

Change-Id: Idc56e961699702eca734cba1da5e56cac0ad4832
Closes-Bug: 1691272
2017-06-06 16:57:33 -04:00
Christopher Dearborn 0c1d56dde5 WSMAN enumerate fails to return all entries
When querying an enumeration using the WSMAN enumerate method, not all
entries are returned if there are more than max_elems (default of 100)
in the enumeration.

When querying an enumeration, the first response returns <wsman:Items>
in the body.  Successive pulls, however, contain <wsen:Items>.

The old code always queried for <wsen:Items>, which caused the first
batch of attributes to be dropped only when the number of entries in
the enumeration exceeded max_elems.

This patch queries for <wsman:Items> in the first response, and for
<wsen:Items> in successive responses.

Change-Id: I2e9036b562c7d7ba5af188dd552b6c67388bb02c
Closes-Bug: #1659052
2017-01-25 11:26:40 -05:00
Imre Farkas 79cace86b6 Add support for lists in wsman properties
Change-Id: I697538153cbac1e0ddf40a85b0149bfea46bbf6a
2015-10-08 10:46:47 +02:00
Imre Farkas d833babfe8 Replacing pywsman with a simple wsman client
Change-Id: I3d87528f1d5286a53e6aba221766aae72513abdb
2015-09-30 09:51:37 +02:00