def addAdapter(self, options, index=None): ''' Insert a networkAdapter before the given index or at the end of the list. options should be a string (name) or a dict ''' adapter = NetworkAdapter(options) adapter.validateAll() if index is not None: self._adapters.insert(index, adapter) else: self._adapters.append(adapter) return adapter
def addAdapter(self, options, index=None): ''' Insert a networkAdapter before the given index or at the end of the list. options should be a string (name) or a dict ''' adapter = NetworkAdapter(options) adapter.validateAll() if index: self._adapters.insert(index, adapter) else: self._adapters.append(adapter) return adapter
def addAdapter(self, options, index=None): """Insert a NetworkAdapter before the given index or at the end of the list. options should be a string (name) or a dict Args: options (string or dict): options to build a network adaptator index (integer, optional): index to insert the NetworkAdapter """ adapter = NetworkAdapter(options) adapter.validateAll() if index is None: self._adapters.append(adapter) else: self._adapters.insert(index, adapter) return adapter