nxos_bgp updates (#24270)

* Remove invoke from nxos_bgp
* Try to simplify get_existing
* Streamline state_present
* More testing, squash & compact get_value & get_custom_value
* Streamline main
* nxapi has problems reading CustomNetworkConfig directly
This commit is contained in:
Nathaniel Case 2017-05-08 11:38:50 -04:00 committed by GitHub
commit 830f19d444
4 changed files with 170 additions and 214 deletions

View file

@ -155,6 +155,9 @@ class NetworkConfig(object):
def __str__(self):
return '\n'.join([c.raw for c in self.items])
def __len__(self):
return len(self._items)
def load(self, s):
self._items = self.parse(s)
@ -368,6 +371,9 @@ class NetworkConfig(object):
class CustomNetworkConfig(NetworkConfig):
def items_text(self):
return [item.text for item in self.items]
def expand_section(self, configobj, S=None):
if S is None:
S = list()