Pass code check.
This commit is contained in:
@@ -21,10 +21,12 @@ OF_KMOD = 'ofdatapath'
|
|||||||
OVS_KMOD = 'openvswitch_mod'
|
OVS_KMOD = 'openvswitch_mod'
|
||||||
TUN = 'tun'
|
TUN = 'tun'
|
||||||
|
|
||||||
def moduleDeps( subtract = [], add = [] ):
|
def moduleDeps( subtract=None, add=None ):
|
||||||
"""Handle module dependencies.
|
"""Handle module dependencies.
|
||||||
subtract: string or list of module names to remove, if already loaded
|
subtract: string or list of module names to remove, if already loaded
|
||||||
add: string or list of module names to add, if not already loaded"""
|
add: string or list of module names to add, if not already loaded"""
|
||||||
|
subtract = subtract if subtract is not None else []
|
||||||
|
add = add if add is not None else []
|
||||||
if type( subtract ) is str:
|
if type( subtract ) is str:
|
||||||
subtract = [ subtract ]
|
subtract = [ subtract ]
|
||||||
if type( add ) is str:
|
if type( add ) is str:
|
||||||
@@ -51,4 +53,4 @@ def moduleDeps( subtract = [], add = [] ):
|
|||||||
error( 'Failed to insert ' + mod + '\n' )
|
error( 'Failed to insert ' + mod + '\n' )
|
||||||
exit( 1 )
|
exit( 1 )
|
||||||
else:
|
else:
|
||||||
debug( '*** ' + mod + ' already loaded\n' )
|
debug( '*** ' + mod + ' already loaded\n' )
|
||||||
|
|||||||
Reference in New Issue
Block a user