Since not all funcs require the CLI commands, the better way of handling
this is to check for presence of the needed funcs and gracefully exit a
state when the function is not present.
This is a bit of a refactor that may need to come with a documentation
update as well. It appears our previous authors made a few assumptions
for the sake of simplicity. Thankfully, they were nice enough to write
the rest of the system to be flexible enough for me to wedge this in.
I rewrote this so that it can handle an interface having v4-only,
v6-only, or v4-and-v6 addresses assigned. It's possible some options I
copied into the V6IF block are not valid inet6 options, but these can be
removed as needed
An IPv6 interface can have any number of IPv6 addresses attached to it,
this will also need to be included.
Commit b2fa638d6d added a lot of extra options. One of these lines (hwaddr) was commented out when it was added. It appears that this was a typo because documentation indicates this line /should/ show up in the interfaces file.
Tests were failing because _parse_interfaces is returning the correct data per mocked data. The assertion was expecting the iface line to have been stripped.
Added a check to make sure inet6 iface lines have the variables needed to prevent a render error.
Also added some whitespace and jinja comment blocks to more easily identify what's going on in this file.
There's a bunch of cool info in the running dictionary that is useful
for summarizing a state run. I'd like to be able to show 'N states from
M files' as well.
Also removed some mocks that were not needed anymore for the
calls to ``file.contains_regex_multiline`` because that function
is no longer called in the state file.
After looking at this a bit more closely, I believe "interface.address" was meant to be "interface.addrfam" which /does/ make sense on this line.
Because of the previous notion that all interfaces will have an address, it seems a second line was created that assumed the only scenario where an iface won't have an address is when dhcp is used. Again, not an accurate assumption. I believe this /should/ handle most expected situations.