self.assertFalse(gpfs._different(None))
def test_sizestr(self):
- self.assertEqual(gpfs._sizestr('0'), '100M')
self.assertEqual(gpfs._sizestr('10'), '10G')
@patch('cinder.utils.execute')
TEST_VOLDIR = 'volumes'
TEST_VOLNAME = 'volume_name'
- TEST_VOLSIZE = '0'
+ TEST_VOLSIZE = '1'
TEST_VOLUME = {
'name': TEST_VOLNAME,
'size': TEST_VOLSIZE
self.TEST_VOLNAME))
self.assertTrue(os.path.isfile(self.TEST_VOLPATH))
self.assertEqual(os.stat(self.TEST_VOLPATH).st_size,
- 100 * units.Mi)
+ 1 * units.Gi)
def test_delete_volume(self):
"""Expected behaviour for delete_volume."""
def _sizestr(size_in_g):
"""Convert the specified size into a string value."""
- if int(size_in_g) == 0:
- # return 100M size on zero input for testing
- return '100M'
return '%sG' % size_in_g
data=exception_message)
def _sizestr(self, size_in_g):
- if int(size_in_g) == 0:
- return '100m'
return '%sg' % size_in_g
def _volume_not_present(self, volume_name):
def create_volume(self, volume):
"""Creates a logical volume."""
- if int(volume['size']) == 0:
- size = 100 * units.Mi
- else:
- size = int(volume['size']) * units.Gi
+ size = int(volume['size']) * units.Gi
LOG.debug("creating volume '%s'" % (volume['name']))
cliq_args['thinProvision'] = '0'
cliq_args['volumeName'] = volume['name']
- if int(volume['size']) == 0:
- cliq_args['size'] = '100MB'
- else:
- cliq_args['size'] = '%sGB' % volume['size']
+ cliq_args['size'] = '%sGB' % volume['size']
self._cliq_run_xml("createVolume", cliq_args)
def create_volume(self, volume):
"""Creates a volume."""
- if int(volume['size']) == 0:
- sizestr = '100M'
- else:
- sizestr = '%sG' % volume['size']
+ sizestr = '%sG' % volume['size']
zfs_poolname = self._build_zfs_poolname(volume)
raise exception.VolumeBackendAPIException(data=msg)
def _size_bytes(self, size_in_g):
- if int(size_in_g) == 0:
- return 100 * units.Mi
return int(size_in_g) * units.Gi
def _create_file(self, path, size):