Merge "Fix for NexentaEdge jsonrpc url formatting"
This commit is contained in:
commit
b6ff1f41b0
|
@ -17,6 +17,7 @@
|
|||
import mock
|
||||
|
||||
from cinder import context
|
||||
from cinder import exception
|
||||
from cinder import test
|
||||
from cinder.volume import configuration as conf
|
||||
from cinder.volume.drivers.nexenta.nexentaedge import iscsi
|
||||
|
@ -102,6 +103,8 @@ class TestNexentaEdgeISCSIDriver(test.TestCase):
|
|||
self.assertRaises(RuntimeError, self.driver.create_volume, MOCK_VOL)
|
||||
|
||||
def test_delete_volume(self):
|
||||
self.mock_api.side_effect = exception.VolumeBackendAPIException(
|
||||
'No volume')
|
||||
self.driver.delete_volume(MOCK_VOL)
|
||||
self.mock_api.assert_called_with(NEDGE_URL, {
|
||||
'objectPath': NEDGE_BUCKET + '/' + MOCK_VOL['id']
|
||||
|
|
|
@ -20,7 +20,7 @@ from oslo_utils import excutils
|
|||
from oslo_utils import units
|
||||
|
||||
from cinder import exception
|
||||
from cinder.i18n import _, _LE
|
||||
from cinder.i18n import _, _LE, _LI
|
||||
from cinder.volume import driver
|
||||
from cinder.volume.drivers.nexenta.nexentaedge import jsonrpc
|
||||
from cinder.volume.drivers.nexenta import options
|
||||
|
@ -164,8 +164,9 @@ class NexentaEdgeISCSIDriver(driver.ISCSIDriver):
|
|||
'/iscsi', {'objectPath': self.bucket_path +
|
||||
'/' + volume['name']})
|
||||
except exception.VolumeBackendAPIException:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception(_LE('Error deleting volume'))
|
||||
LOG.info(
|
||||
_LI('Volume was already deleted from appliance, skipping.'),
|
||||
resource=volume)
|
||||
|
||||
def extend_volume(self, volume, new_size):
|
||||
try:
|
||||
|
|
|
@ -47,8 +47,8 @@ class NexentaEdgeJSONProxy(object):
|
|||
|
||||
@property
|
||||
def url(self):
|
||||
return '%s://%s:%s%s' % (self.protocol,
|
||||
self.host, self.port, self.path)
|
||||
return '%s://%s:%s/%s' % (self.protocol,
|
||||
self.host, self.port, self.path)
|
||||
|
||||
def __getattr__(self, name):
|
||||
if not self.method:
|
||||
|
@ -68,7 +68,7 @@ class NexentaEdgeJSONProxy(object):
|
|||
|
||||
@retry(retry_exc_tuple, interval=1, retries=6)
|
||||
def __call__(self, *args):
|
||||
self.path += args[0]
|
||||
self.path = args[0]
|
||||
data = None
|
||||
if len(args) > 1:
|
||||
data = json.dumps(args[1])
|
||||
|
@ -79,7 +79,7 @@ class NexentaEdgeJSONProxy(object):
|
|||
'Authorization': 'Basic %s' % auth
|
||||
}
|
||||
|
||||
LOG.debug('Sending JSON data: %s', self.url)
|
||||
LOG.debug('Sending JSON data: %s, data: %s', self.url, data)
|
||||
|
||||
if self.method == 'get':
|
||||
req = requests.get(self.url, headers=headers)
|
||||
|
|
|
@ -44,7 +44,7 @@ NEXENTA_EDGE_OPTS = [
|
|||
help='NexentaEdge iSCSI Gateway client '
|
||||
'address for non-VIP service'),
|
||||
cfg.IntOpt('nexenta_chunksize',
|
||||
default=16384,
|
||||
default=32768,
|
||||
help='NexentaEdge iSCSI LUN object chunk size')
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue