@@ -290,15 +290,17 @@ def mount(self, fstype, export, vol_name, mountpoint, instance, options):
290
290
'options=%(options)s) generation %(gen)s' ,
291
291
{'fstype' : fstype , 'export' : export , 'vol_name' : vol_name ,
292
292
'mountpoint' : mountpoint , 'options' : options ,
293
- 'gen' : self .generation })
293
+ 'gen' : self .generation }, instance = instance )
294
294
with self ._get_locked (mountpoint ) as mount :
295
295
if os .path .ismount (mountpoint ):
296
296
LOG .debug (('Mounting %(mountpoint)s generation %(gen)s, '
297
297
'mountpoint already mounted' ),
298
- {'mountpoint' : mountpoint , 'gen' : self .generation })
298
+ {'mountpoint' : mountpoint , 'gen' : self .generation },
299
+ instance = instance )
299
300
else :
300
301
LOG .debug ('Mounting %(mountpoint)s generation %(gen)s' ,
301
- {'mountpoint' : mountpoint , 'gen' : self .generation })
302
+ {'mountpoint' : mountpoint , 'gen' : self .generation },
303
+ instance = instance )
302
304
303
305
fileutils .ensure_tree (mountpoint )
304
306
@@ -316,7 +318,7 @@ def mount(self, fstype, export, vol_name, mountpoint, instance, options):
316
318
'%(mountpoint)s. Continuing because mountpount is '
317
319
'mounted despite this.' ,
318
320
{'fstype' : fstype , 'export' : export ,
319
- 'mountpoint' : mountpoint })
321
+ 'mountpoint' : mountpoint }, instance = instance )
320
322
else :
321
323
# If the mount failed there's no reason for us to keep
322
324
# a record of it. It will be created again if the
@@ -331,7 +333,8 @@ def mount(self, fstype, export, vol_name, mountpoint, instance, options):
331
333
332
334
LOG .debug ('_HostMountState.mount() for %(mountpoint)s '
333
335
'generation %(gen)s completed successfully' ,
334
- {'mountpoint' : mountpoint , 'gen' : self .generation })
336
+ {'mountpoint' : mountpoint , 'gen' : self .generation },
337
+ instance = instance )
335
338
336
339
def umount (self , vol_name , mountpoint , instance ):
337
340
"""Mark an attachment as no longer in use, and unmount its mountpoint
@@ -345,16 +348,15 @@ def umount(self, vol_name, mountpoint, instance):
345
348
LOG .debug ('_HostMountState.umount(vol_name=%(vol_name)s, '
346
349
'mountpoint=%(mountpoint)s) generation %(gen)s' ,
347
350
{'vol_name' : vol_name , 'mountpoint' : mountpoint ,
348
- 'gen' : self .generation })
351
+ 'gen' : self .generation }, instance = instance )
349
352
with self ._get_locked (mountpoint ) as mount :
350
353
try :
351
354
mount .remove_attachment (vol_name , instance .uuid )
352
355
except KeyError :
353
- LOG .warning ("Request to remove attachment "
354
- "(%(vol_name)s, %(instance)s) from "
356
+ LOG .warning ("Request to remove attachment (%(vol_name)s from "
355
357
"%(mountpoint)s, but we don't think it's in use." ,
356
- {'vol_name' : vol_name , 'instance ' : instance . uuid ,
357
- 'mountpoint' : mountpoint } )
358
+ {'vol_name' : vol_name , 'mountpoint ' : mountpoint } ,
359
+ instance = instance )
358
360
359
361
if not mount .in_use ():
360
362
mounted = os .path .ismount (mountpoint )
@@ -368,7 +370,8 @@ def umount(self, vol_name, mountpoint, instance):
368
370
369
371
LOG .debug ('_HostMountState.umount() for %(mountpoint)s '
370
372
'generation %(gen)s completed successfully' ,
371
- {'mountpoint' : mountpoint , 'gen' : self .generation })
373
+ {'mountpoint' : mountpoint , 'gen' : self .generation },
374
+ instance = instance )
372
375
373
376
def _real_umount (self , mountpoint ):
374
377
# Unmount and delete a mountpoint.
0 commit comments