@@ -109,8 +109,8 @@ class TestVolumeGroupSizing(object):
109109
110110 def setup_method (self ):
111111 self .vg = api .VolumeGroup (vg_name = 'ceph' ,
112- vg_extent_size = 1073741824 ,
113- vg_free_count = 1024 )
112+ vg_extent_size = 1073741824 ,
113+ vg_free_count = 1024 )
114114
115115 def test_parts_and_size_errors (self ):
116116 with pytest .raises (ValueError ) as error :
@@ -194,8 +194,8 @@ def setup_method(self):
194194 @patch ('ceph_volume.api.lvm.get_single_lv' )
195195 def test_uses_size (self , m_get_single_lv , m_call , m_run , monkeypatch ):
196196 m_get_single_lv .return_value = self .foo_volume
197- api .create_lv ('foo' , 0 , vg = self .foo_group , size = 419430400 , tags = {'ceph.type' : 'data' })
198- expected = (['lvcreate' , '--yes' , '-l' , '100' , '-n' , 'foo-0 ' , 'foo_group' ])
197+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , size = 419430400 , tags = {'ceph.type' : 'data' })
198+ expected = (['lvcreate' , '--yes' , '-l' , '100' , '-n' , 'foo-1234-abcd ' , 'foo_group' ])
199199 m_run .assert_called_with (expected , run_on_host = True )
200200
201201 @patch ('ceph_volume.api.lvm.process.run' )
@@ -209,8 +209,8 @@ def test_uses_size_adjust_if_1percent_over(self, m_get_single_lv, m_call, m_run,
209209 vg_free_count = "1000" )
210210 m_get_single_lv .return_value = foo_volume
211211 # 423624704 should be just under 1% off of the available size 419430400
212- api .create_lv ('foo' , 0 , vg = foo_group , size = 4232052736 , tags = {'ceph.type' : 'data' })
213- expected = ['lvcreate' , '--yes' , '-l' , '1000' , '-n' , 'foo-0 ' , 'foo_group' ]
212+ api .create_lv ('foo' , '1234-abcd' , vg = foo_group , size = 4232052736 , tags = {'ceph.type' : 'data' })
213+ expected = ['lvcreate' , '--yes' , '-l' , '1000' , '-n' , 'foo-1234-abcd ' , 'foo_group' ]
214214 m_run .assert_called_with (expected , run_on_host = True )
215215
216216 @patch ('ceph_volume.api.lvm.process.run' )
@@ -219,15 +219,15 @@ def test_uses_size_adjust_if_1percent_over(self, m_get_single_lv, m_call, m_run,
219219 def test_uses_size_too_large (self , m_get_single_lv , m_call , m_run , monkeypatch ):
220220 m_get_single_lv .return_value = self .foo_volume
221221 with pytest .raises (RuntimeError ):
222- api .create_lv ('foo' , 0 , vg = self .foo_group , size = 5368709120 , tags = {'ceph.type' : 'data' })
222+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , size = 5368709120 , tags = {'ceph.type' : 'data' })
223223
224224 @patch ('ceph_volume.api.lvm.process.run' )
225225 @patch ('ceph_volume.api.lvm.process.call' )
226226 @patch ('ceph_volume.api.lvm.get_single_lv' )
227227 def test_uses_extents (self , m_get_single_lv , m_call , m_run , monkeypatch ):
228228 m_get_single_lv .return_value = self .foo_volume
229- api .create_lv ('foo' , 0 , vg = self .foo_group , extents = '50' , tags = {'ceph.type' : 'data' })
230- expected = ['lvcreate' , '--yes' , '-l' , '50' , '-n' , 'foo-0 ' , 'foo_group' ]
229+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , extents = '50' , tags = {'ceph.type' : 'data' })
230+ expected = ['lvcreate' , '--yes' , '-l' , '50' , '-n' , 'foo-1234-abcd ' , 'foo_group' ]
231231 m_run .assert_called_with (expected , run_on_host = True )
232232
233233 @pytest .mark .parametrize ("test_input,expected" ,
@@ -238,17 +238,17 @@ def test_uses_extents(self, m_get_single_lv, m_call, m_run, monkeypatch):
238238 @patch ('ceph_volume.api.lvm.get_single_lv' )
239239 def test_uses_slots (self , m_get_single_lv , m_call , m_run , monkeypatch , test_input , expected ):
240240 m_get_single_lv .return_value = self .foo_volume
241- api .create_lv ('foo' , 0 , vg = self .foo_group , slots = test_input , tags = {'ceph.type' : 'data' })
242- expected = ['lvcreate' , '--yes' , '-l' , str (expected ), '-n' , 'foo-0 ' , 'foo_group' ]
241+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , slots = test_input , tags = {'ceph.type' : 'data' })
242+ expected = ['lvcreate' , '--yes' , '-l' , str (expected ), '-n' , 'foo-1234-abcd ' , 'foo_group' ]
243243 m_run .assert_called_with (expected , run_on_host = True )
244244
245245 @patch ('ceph_volume.api.lvm.process.run' )
246246 @patch ('ceph_volume.api.lvm.process.call' )
247247 @patch ('ceph_volume.api.lvm.get_single_lv' )
248248 def test_uses_all (self , m_get_single_lv , m_call , m_run , monkeypatch ):
249249 m_get_single_lv .return_value = self .foo_volume
250- api .create_lv ('foo' , 0 , vg = self .foo_group , tags = {'ceph.type' : 'data' })
251- expected = ['lvcreate' , '--yes' , '-l' , '100%FREE' , '-n' , 'foo-0 ' , 'foo_group' ]
250+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , tags = {'ceph.type' : 'data' })
251+ expected = ['lvcreate' , '--yes' , '-l' , '100%FREE' , '-n' , 'foo-1234-abcd ' , 'foo_group' ]
252252 m_run .assert_called_with (expected , run_on_host = True )
253253
254254 @patch ('ceph_volume.api.lvm.process.run' )
@@ -257,7 +257,7 @@ def test_uses_all(self, m_get_single_lv, m_call, m_run, monkeypatch):
257257 @patch ('ceph_volume.api.lvm.get_single_lv' )
258258 def test_calls_to_set_tags_default (self , m_get_single_lv , m_set_tags , m_call , m_run , monkeypatch ):
259259 m_get_single_lv .return_value = self .foo_volume
260- api .create_lv ('foo' , 0 , vg = self .foo_group )
260+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group )
261261 tags = {
262262 "ceph.osd_id" : "null" ,
263263 "ceph.type" : "null" ,
@@ -272,7 +272,7 @@ def test_calls_to_set_tags_default(self, m_get_single_lv, m_set_tags, m_call, m_
272272 @patch ('ceph_volume.api.lvm.get_single_lv' )
273273 def test_calls_to_set_tags_arg (self , m_get_single_lv , m_set_tags , m_call , m_run , monkeypatch ):
274274 m_get_single_lv .return_value = self .foo_volume
275- api .create_lv ('foo' , 0 , vg = self .foo_group , tags = {'ceph.type' : 'data' })
275+ api .create_lv ('foo' , '1234-abcd' , vg = self .foo_group , tags = {'ceph.type' : 'data' })
276276 tags = {
277277 "ceph.type" : "data" ,
278278 "ceph.data_device" : "/path"
@@ -288,7 +288,7 @@ def test_create_vg(self, m_get_single_lv, m_create_vg, m_get_device_vgs, m_call,
288288 m_run , monkeypatch ):
289289 m_get_single_lv .return_value = self .foo_volume
290290 m_get_device_vgs .return_value = []
291- api .create_lv ('foo' , 0 , device = 'dev/foo' , size = '5G' , tags = {'ceph.type' : 'data' })
291+ api .create_lv ('foo' , '1234-abcd' , device = 'dev/foo' , size = '5G' , tags = {'ceph.type' : 'data' })
292292 m_create_vg .assert_called_with ('dev/foo' , name_prefix = 'ceph' )
293293
294294
0 commit comments