ciscoconfparse.IOSConfigList Object

class ciscoconfparse.IOSConfigList(data=None, comment_delimiter='!', debug=False, factory=False, ignore_blank_lines=True, syntax='ios', CiscoConfParse=None)

A custom list to hold IOSCfgLine objects. Most people will never need to use this class directly.

Initialize the class.

Parameters
datalist

A list of parsed IOSCfgLine objects

comment_delimiterstr

A comment delimiter. This should only be changed when parsing non-Cisco IOS configurations, which do not use a ! as the comment delimiter. comment defaults to ‘!’

debugbool

debug defaults to False, and should be kept that way unless you’re working on a very tricky config parsing problem. Debug output is not particularly friendly

ignore_blank_linesbool

ignore_blank_lines defaults to True; when this is set True, ciscoconfparse ignores blank configuration lines. You might want to set ignore_blank_lines to False if you intentionally use blank lines in your configuration (ref: Github Issue #2).

Returns
An instance of an IOSConfigList object.
__repr__()

Return repr(self).

__str__()

Return str(self).

append(val)

S.append(value) – append value to the end of the sequence

clear() → None – remove all items from S
config_hierarchy()

Walk this configuration and return the following tuple at each parent ‘level’: (list_of_parent_sibling_objs, list_of_nonparent_sibling_objs)

count(value) → integer – return number of occurrences of value
extend(values)

S.extend(iterable) – extend sequence by appending elements from the iterable

index(value[, start[, stop]]) → integer – return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

insert(ii, val)

S.insert(index, value) – insert value before index

pop([index]) → item – remove and return item at index (default last).

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse()

S.reverse() – reverse IN PLACE