Commit Graph

47 Commits

Author SHA1 Message Date
Stack 64cb39b9da Add unit tests for Left Hand client
This commit has unit test cases for Left hand client
to increase code coverage of client.

Change-Id: Ia8576ce971d9ef7554446d0fa028954565f1bff0
2016-09-28 23:44:44 -07:00
Anthony Lee db9773f0f9 Updates client version to 2.1.0
Updates the client version to 2.1.0.

Change-Id: I495dcaceeadcb7a40f376a2e0397c55728b61d58
2016-01-12 16:31:44 -08:00
Anthony Lee 737398bbeb Fixes the README underline formatting
Fixes the underline formatting so the rst is rendered
properly on pypi.

Change-Id: I76f5d5b4a1052b39ac4c5c9cbb49f57613a936a7
2016-01-12 16:17:48 -08:00
Kurt Martin ed8c295495 Merge "Add fancy pypi images" 2016-01-11 14:26:59 -08:00
Anthony Lee 68a2bd6f02 Adds an API for retrieving snapshot parent name
Adds a new API for retrieving a snapshot's parent volume name.

SSH is used as there is currently no way to get this
information from the LH REST API.

Change-Id: I92921eb2eaaa0a18633b0883dfe990ae1d2cde0d
2016-01-08 14:18:55 -08:00
Walter A. Boring IV 18d792eef7 Add fancy pypi images
I added the version and downloads image to os-brick
a while back.  You can view them here:
https://pypi.python.org/pypi/os-brick

This patch adds those image specific to the lefthand client

Change-Id: I4eea8a5fdeebbdf023a61de2c98d6bf0876e60a7
2016-01-08 03:12:05 -08:00
Alex O'Rourke 85134064ab Add remote copy support
Adds support for remote copy via SSH. Newly added API calls
include:
    - makeVolumeRemote
    - makeVolumePrimary
    - createRemoteSnapshotSchedule
    - deleteRemoteSnapshotSchedule
    - getRemoteSnapshotSchedule
    - stopRemoteSnapshotSchedule
    - startRemoteSnapshotSchedule
    - doesRemoteSnapshotScheduleExist
    - getIPFromCluster

The option for running remote copy tests against live arrays is now
available through the config.ini file.

Change-Id: I6be740d57e87cd7ef46fdafadaca4778441dbdfd
2015-12-21 14:46:52 -08:00
Alex O'Rourke 84de6562e1 Add SSH support to LeftHand Client
SSH is needed to make Remote Copy related calls to a LeftHand array.
Currently, SSH support is not available in the client. This patch adds
such capabilities.

Change-Id: I50ff9e31c3d3fac97bbabb95880346795f3b4656
2015-12-15 16:55:06 -08:00
Anthony Lee e8a8478c1b Add a new API for modifying snapshots
The new API allows modification of snapshot options.

This allows for renaming of a snapshot which is used in
actions such as manage/unmanage of snapshots.

Change-Id: Ib0305e3ca5ef7cebbe3d46de64e849284a5dc763
2015-12-10 15:13:50 -08:00
Alex O'Rourke b7eb87a397 Changes exception's isinstance str to basestring
The error description was not being displayed when an exception
was being raised. This was due to the patch merged in from
issue #12 (reported in the 3PAR client), which changed the body
to type bytes instead of typestr.  The check in exceptions.py is
now updated to represent this change.

Change-Id: I471192a38b47f118114239fce63c52c9764b1ac9
2015-11-17 16:52:36 -08:00
Alex O'Rourke 970b2bf6a4 Allow suppressing of SSL log warnings
Currently there is no way to suppress this warning, making the log
file bogged down with these messages. There should be an override
flag that allows you to willingly disabled these log messages.

Change-Id: Ie8a65feb2e9c3cfb666861157e2236e90e25ee29
2015-11-17 11:11:23 -08:00
Anthony Lee b6e4689754 Rebranding the hplefthandclient
This patch changes all references to HP in the client to now
be HPE.
The client itself is also renamed to hpelefthandclient.
The new version for this client is 2.0.0.

Change-Id: I7bfb20e5619b93bd1d7e0b7728932eb36bb0dad9
2015-11-13 15:47:35 -08:00
Alex O'Rourke e82d751f6d Replaces httplib2 with Python Requests support
httplib2 is no longer maintained and may pose a security threat.
All calls and imports from httlib2 have been removed and replaced
with Python Requests.

Change-Id: I3cb24d34b990ecf3d8387bc194046806fdbfd06c
2015-10-02 08:45:03 -07:00
Anthony Lee f920a8302f Adds unit tests for the LeftHand Exception class
The Exception class for the LeftHand client did not have any
unit tests.

This patch adds unit tests that check the output from the
from_response function and the ClientException class when an
error is passed in.

This patch also removed the use of 'ref' from the
ClientException class. It was added in fa50dedd but was
never officially released so it will not be deprecated.

Change-Id: Ifeb0687e00808155fda116ac97abcf6afaedbff5
2015-08-26 10:49:24 -07:00
Alex O'Rourke f97ba335db Fixes error description and code not being saved
In LeftHand, the error exception returns messageID and message, we
are currently looking at code and desc, which do not exist. This patch
saves the correct values. This patch also throws the correct values in
the flask server as well.

There are some driver functions that look at the exact error message,
so having this saved properly is important.

Change-Id: I21399d6a7a2932485df34b2dda40c789e5edd746
2015-08-24 14:40:43 -07:00
Alex O'Rourke aa75effc14 Adds support for snapshotting muliple volumes
Snapshotting multiple volumes at once is needed for consistency
group support. Version 12.5 of the LeftHand API supports this
feature, a client call is needed to invoke it.

Change-Id: I6399270c6a0742d09fdb88fa13af84dca4e9c718
2015-08-17 10:16:17 -07:00
Alex O'Rourke 3388c6f2ee Fixes ex_desc order of operation issue
Fixes order of operations for the case where ex_desc is None
during a client initialization.

Change-Id: Iec12352430e107518a5dcfca9a78404063ddd0bd
2015-08-14 10:33:09 -07:00
Alex O'Rourke f1f1bd0ce6 Revert "Replaces httplib2 with Python Requests support"
This reverts commit 5f62c0b65b.

Change-Id: Ib51adff04dc17651f52945d1459b536a8c675c93
2015-08-14 09:25:37 -07:00
Alex O'Rourke 13396d5846 Fixing createVolume clusterId
In createVolume, clusterID is posted to the LeftHand API which is
incorrect and causes errors if the optional parameter clusterName
is not provided as well. clusterId should be posted instead.

Closes-Issue #3

Change-Id: Ief3d8748d3c665b6c1c4b95d875776bc599e6651
2015-08-12 09:53:25 -07:00
Alex O'Rourke 5f62c0b65b Replaces httplib2 with Python Requests support
httplib2 is no longer maintained and may pose a security threat.
All calls and imports from httlib2 have been removed and replaced
with Python Requests.

Fixes order of operations for the case where ex_desc is None
during a client initialization.

Change-Id: I36f228fd72f52b239572915df931780d0ced3388
2015-08-03 08:42:10 -07:00
Alex O'Rourke 3fcd688035 Making the client Python3.4+ Compliant
Client is fully compatible with Python3.4+. New requirements and test
requirements files have been added for Python3.4 to use instead
of the default files Python2.x looks at.

Tox now supports py34 testing. An additional section in tox.ini was
added to support this.

Basic Python calls have been modified in order to allow backwards
compatability between Python2.x and Python3.4.

Change-Id: I10ad569e5621e133d92561c6951b3a6ab8dfd4d7
2015-07-17 10:42:41 -07:00
Anthony Lee fa50dedddc Adding more descriptive exception messages to client
Errors occuring during login were not very descriptive. This
patch adds more details about why a login to a LH backend failed.

Also, added the ability to toggle debug on before the client has
been initialized.

bug reference:
https://github.com/hp-storage/python-3parclient/issues/9

Change-Id: I7fe700ae11703dabd82436a105f634ddd5e8b8b1
2015-03-03 14:59:08 -08:00
Anthony Lee 87f68a2ca1 Added query options to getVolumes
Updated getVolumes so it can be limited to query volumes based on
a clusterName or/and with smaller set of fields.

Added a unit test.

Updated findInDict in base class to be able to just check the key.

Change-Id: I7d647917f2ca48e259a55ed32f23ea5378d3b0fa
2015-02-24 13:26:55 -08:00
Gary W. Smith 5fedfc403e Normalize unit tests
Change README and test code so that tests are run from the top-level
directory.
Incorporated instructions for running with tox.

Change-Id: I278d29c47906461dfd4a0efbfff441a4cd924cb2
2015-02-24 11:42:38 -08:00
Kurt Martin c8d223a1ec Update GitHub account to hp-storage
Updated the GitHub account references from WaltHP to hp-storage. The
repos have already been transfered to the new account. Update install
example to use "pip install ."

Change-Id: I3a08b0cb6476ade978a6c1f1a1b21e40ba5baee2
2015-02-24 10:36:53 -08:00
Ramy Asselin 92a9540a21 Update tox to generate docs & code coverage output
Change-Id: If4991deb68889d47e9530f56b008d005495b070c
2015-02-23 05:24:04 -08:00
Anthony Lee 95f4cf660c PEP8 violation fixes for LeftHand
Fixing PEP8 violations in LeftHand.

Change-Id: I55a47877037240f17cce088237223b8d2275ae94
2015-02-19 13:01:31 -08:00
Anthony Lee 50417e3a81 Adding API for Getting API Version
Added a new API to get the API version for a LeftHand backend.

Change-Id: If309141942fee851b0be2853b24628c975cf234a
2015-02-13 17:12:53 -08:00
Anthony Lee 48996b77c2 Updated setup.py and requirements
Updated setup.py to have correct test-requirements.
Updated requirements and test-requirements to contain
the proper packages.

Change-Id: Ib3ec3abaf2cc0eb27e0ff3ad4574207eee088611
2015-01-06 08:44:23 -08:00
Anthony Lee b71801ca0a Fixing duplicate debug log messages
Fixed a bug where multiple loggers would be created if the
LeftHand client was initialized multiple times.  Debug messages
would then start repeating and making debugging difficult.

This fix is similar to the fix in the 3PAR client.

Change-Id: Ia1af8e608f5d703931b87223e46dc398cd715484
2014-12-16 12:12:23 -08:00
Anthony Lee cf83528ae9 Documentation fixes
Fixed various typos/errors/missing pages in the documentation.

Change-Id: Ia254d472780434b159c08a8bd11004914ea9dfbc
2014-12-12 16:19:05 -08:00
Anthony Lee c6a1ca2396 Update version and docs
Changed version to 1.0.3.
Updated docs for the new API 'findServerVolumes'

Change-Id: I7b0cd0e5bdba05a9d1a2c424fbad678a256b70eb
2014-12-12 13:29:58 -08:00
Anthony Lee 8a291dadf1 Fixing pep8 violations in LeftHand
Added pep8 support to tox.
Fixed pep8 violations.
Removed two unneeded print statements.

Change-Id: Ia36400e1f12a7147adcdecb8ed66a0e72cd86070
2014-12-10 03:18:33 -08:00
Anthony Lee 133e9b4d2e Adding new unit test to check volume sizes
Added a new unit test to make sure that volumes are created
with the correct size.

Change-Id: Ic0d4194a9661447d5f8907095ac252ce463b0e11
2014-12-01 09:13:12 -08:00
Anthony Lee 1115089e8d Adding support for findServerVolumes
findServerVolumes added to the client.
Unit tests for server functions in the client added.
Removed unneeded print outputs during tearDown of unit tests.
Minor typo corrections.
Renamed test_HPLeftHandMockServer_flask to HPLeftHandMockServer_flask.

Change-Id: I7bbf5fa6f67efdf9bff272286cd057078a5b509c
2014-12-01 04:36:49 -08:00
Anthony Lee 2f9950d439 Added more detail to unit test output
Enabled verbose output to give more details about
unit tests and whether they passed/failed.

Change-Id: Ib9b194353c69216fb75e7d92e563cfb69602e5ea
2014-07-21 17:40:58 -07:00
Rahul Verma afed1024f3 Made Test Volume Names Time-Unique To Avoid Test Problems
When the test creates volumes, the volumes are now named
after the time they were created at. This is to avoid
attempts to create two volumes with the same name by
two simultaneous Jenkins jobs. This patch is based on
a  previous patch but now depends on tox.

Change-Id: I89e75375cf5e5cdfd45eb0c4e850b126f55a4348
2014-07-21 17:23:03 -07:00
Anthony Lee 67f387674f Add tox support for unit tests
Added files needed for running unit tests with tox.

Change-Id: I3c75cfef21f04cacaec6b4e116771a512c1923bd
2014-07-21 17:09:54 -07:00
Ramy Asselin ef2e6ee87a Update version number to 1.0.3 2014-04-08 09:53:29 -07:00
Ramy Asselin 7e4105dcc3 Merge pull request #1 from javacruft/master
Add missing imports for Flask
2014-04-08 09:33:44 -07:00
James Page 65f7db0a17 Add missing imports for Flask
Running unit tests against the mock LHOS server fails due
to missing Flask imports.
2014-03-11 12:49:07 +00:00
Jim Branen 5c42833909 Added support for query parameter in getVolume 2014-02-28 12:53:25 -08:00
Kurt Martin b65eeacf60 Update change log for version 1.0.1 2014-01-07 14:42:40 -08:00
Kurt Martin 52b5f42828 Modify to support Python 3.0
Update the code to change issue found by running 2to3 utility.
2014-01-07 13:27:12 -08:00
Walter A. Boring IV 86e1c3178a removed the built docs from the repository 2013-12-12 16:46:59 -08:00
Walter A. Boring IV 943f1f189d minor docs fixes 2013-12-12 16:43:05 -08:00
Kurt Martin fc5818cc11 Initial commit of the hplefthand client 2013-12-12 16:25:45 -08:00