summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem@us.ibm.com>2015-09-02 17:05:46 -0700
committerMatt Riedemann <mriedem@us.ibm.com>2015-09-02 19:08:09 -0700
commiteaf1e56b210c94e7d26ca99b5931f3688cef984c (patch)
tree6a36cc67ad433409832c2ea2e3d6b25fb7c2d4d7
parent893bf9313c2efb78d30fc5df3b67313eec154caa (diff)
downloadpython-novaclient-eaf1e56b210c94e7d26ca99b5931f3688cef984c.tar.gz
Update path to subunit2html in post_test_hook
Per: http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html The location of subunit2html changed on the images in the gate so update the path used in the post_test_hook. Long-term we should just use what's in devstack-gate. Change-Id: I5e50e7d7ad845aba26403df1df412c0a139a6dc7 Closes-Bug: #1491646 -------------- squashed with: -------------- Don't pass null device when attaching a volume The v2.1 API schema rejects null device values in an os-volume_attachments request, so only include the device in the request if one is specified on the command line. Closes-Bug: #1491325 Change-Id: I4fa4019f19f9af6ff350db2fb6e524fa8570a6f3
-rwxr-xr-xnovaclient/tests/functional/hooks/post_test_hook.sh2
-rw-r--r--novaclient/tests/unit/v2/test_shell.py3
-rw-r--r--novaclient/v2/volumes.py9
3 files changed, 7 insertions, 7 deletions
diff --git a/novaclient/tests/functional/hooks/post_test_hook.sh b/novaclient/tests/functional/hooks/post_test_hook.sh
index 8eff1fd2..1fa2618b 100755
--- a/novaclient/tests/functional/hooks/post_test_hook.sh
+++ b/novaclient/tests/functional/hooks/post_test_hook.sh
@@ -18,7 +18,7 @@ function generate_testr_results {
if [ -f .testrepository/0 ]; then
sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit
sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
- sudo .tox/functional/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
+ sudo /usr/os-testr-env/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
sudo gzip -9 $BASE/logs/testrepository.subunit
sudo gzip -9 $BASE/logs/testr_results.html
sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py
index cfd81fcc..603e59ec 100644
--- a/novaclient/tests/unit/v2/test_shell.py
+++ b/novaclient/tests/unit/v2/test_shell.py
@@ -2293,8 +2293,7 @@ class ShellTest(utils.TestCase):
self.run_command('volume-attach sample-server Work')
self.assert_called('POST', '/servers/1234/os-volume_attachments',
{'volumeAttachment':
- {'device': None,
- 'volumeId': 'Work'}})
+ {'volumeId': 'Work'}})
def test_volume_update(self):
self.run_command('volume-update sample-server Work Work')
diff --git a/novaclient/v2/volumes.py b/novaclient/v2/volumes.py
index f0403af6..d0446c5f 100644
--- a/novaclient/v2/volumes.py
+++ b/novaclient/v2/volumes.py
@@ -131,17 +131,18 @@ class VolumeManager(base.ManagerWithFind):
with self.alternate_service_type('volume'):
self._delete("/volumes/%s" % base.getid(volume))
- def create_server_volume(self, server_id, volume_id, device):
+ def create_server_volume(self, server_id, volume_id, device=None):
"""
Attach a volume identified by the volume ID to the given server ID
:param server_id: The ID of the server
:param volume_id: The ID of the volume to attach.
- :param device: The device name
+ :param device: The device name (optional)
:rtype: :class:`Volume`
"""
- body = {'volumeAttachment': {'volumeId': volume_id,
- 'device': device}}
+ body = {'volumeAttachment': {'volumeId': volume_id}}
+ if device is not None:
+ body['volumeAttachment']['device'] = device
return self._create("/servers/%s/os-volume_attachments" % server_id,
body, "volumeAttachment")