@@ -1911,7 +1911,7 @@ def _get_filtered_ifacenames_with_classes(self, all_itf, allow_classes, excludep
1911
1911
1912
1912
return filtered_ifacenames
1913
1913
1914
- def down (self , ops , auto = False , allow_classes = None , ifacenames = None ,
1914
+ def down (self , ops , all_itf = False , allow_classes = None , ifacenames = None ,
1915
1915
excludepats = None , printdependency = None , usecurrentconfig = False ,
1916
1916
type = None ):
1917
1917
""" down an interface """
@@ -1922,7 +1922,7 @@ def down(self, ops, auto=False, allow_classes=None, ifacenames=None,
1922
1922
ifupdownflags .flags .CLASS = True
1923
1923
if not self .flags .ADDONS_ENABLE :
1924
1924
self .flags .STATEMANAGER_UPDATE = False
1925
- if auto :
1925
+ if all_itf :
1926
1926
ifupdownflags .flags .ALL = True
1927
1927
ifupdownflags .flags .WITH_DEPENDS = True
1928
1928
# For down we need to look at old state, unless usecurrentconfig
@@ -1943,33 +1943,16 @@ def down(self, ops, auto=False, allow_classes=None, ifacenames=None,
1943
1943
if excludepats :
1944
1944
excludepats = self ._preprocess_excludepats (excludepats )
1945
1945
1946
- filtered_ifacenames = None
1947
- if ifacenames :
1948
- # If iface list is given by the caller, always check if iface
1949
- # is present
1950
- try :
1951
- ifacenames = self ._preprocess_ifacenames (ifacenames )
1952
-
1953
- if allow_classes :
1954
- filtered_ifacenames = self ._get_filtered_ifacenames_with_classes (auto , allow_classes , excludepats , ifacenames )
1955
-
1956
- except Exception as e :
1957
- raise Exception ('%s' % str (e ) +
1958
- ' (interface was probably never up ?)' )
1959
-
1960
-
1961
- # if iface list not given by user, assume all from config file
1962
- if not ifacenames : ifacenames = list (self .ifaceobjdict .keys ())
1963
-
1964
- if not filtered_ifacenames :
1965
- # filter interfaces based on auto and allow classes
1966
- filtered_ifacenames = [i for i in ifacenames
1967
- if self ._iface_whitelisted (auto , allow_classes ,
1968
- excludepats , i )]
1946
+ try :
1947
+ # Get a filtered list of interfaces to work on
1948
+ filtered_ifacenames = self ._get_filtered_ifacenames_with_classes (
1949
+ all_itf , allow_classes , excludepats , ifacenames )
1950
+ except Exception as e :
1951
+ raise Exception ('%s' % str (e ) +
1952
+ ' (interface was probably never up ?)' )
1969
1953
1970
1954
if not filtered_ifacenames :
1971
- raise Exception ('no ifaces found matching given allow lists ' +
1972
- '(or interfaces were probably never up ?)' )
1955
+ return
1973
1956
1974
1957
if printdependency :
1975
1958
self .populate_dependency_info (ops , filtered_ifacenames )
0 commit comments