@@ -249,10 +249,14 @@ def partition(predicate, iterable):
249
249
# Module is loaded and we don't want it?
250
250
if not present and present_mods :
251
251
yield 'modprobe{0} -r -a {1}' .format (args , ' ' .join (present_mods ))
252
+ for mod in present_mods :
253
+ modules .pop (mod )
252
254
253
255
# Module isn't loaded and we want it?
254
256
elif present and missing_mods :
255
257
yield 'modprobe{0} -a {1}' .format (args , ' ' .join (missing_mods ))
258
+ for mod in missing_mods :
259
+ modules [mod ] = {}
256
260
257
261
else :
258
262
host .noop ('{0} {1} {2} {3}' .format (
@@ -299,17 +303,20 @@ def mount(
299
303
' -o {0}' .format (options_string ) if options_string else '' ,
300
304
path ,
301
305
)
306
+ mounts [path ] = {'options' : options }
302
307
303
308
# Want no mount but mounted?
304
309
elif mounted is False and is_mounted :
305
310
yield 'umount {0}' .format (path )
311
+ mounts .pop (path )
306
312
307
313
# Want mount and is mounted! Check the options
308
314
elif is_mounted and mounted and options :
309
315
mounted_options = mounts [path ]['options' ]
310
316
needed_options = set (options ) - set (mounted_options )
311
317
if needed_options :
312
318
yield 'mount -o remount,{0} {1}' .format (options_string , path )
319
+ mounts [path ]['options' ] = options
313
320
314
321
else :
315
322
host .noop ('filesystem {0} is {1}' .format (
0 commit comments