ciscoconfparse icon indicating copy to clipboard operation
ciscoconfparse copied to clipboard

Fix functionality of delete_children_matching

Open jgsawyers opened this issue 2 years ago • 3 comments

Fixes two issues with delete_children_matching as reported on #241 that I just ran into myself as well. Casts the resulting iterable from filter into a list. Since it's consumed by both the list comprehension for retval, it was already exhausted when arriving at the map. Also uses to deque to consume the map iterable, as it's not executed until the items are iterated over. (I think this behavior changed somewhere in 3.x, it used to return a list) Could also just cast to a list of refactor to a for loop here, but I think deque is the fastest way to consume it.

jgsawyers avatar Jul 09 '22 01:07 jgsawyers

Sure, can do. Wasn't sure if the filter\map were there for legacy reasons. I can clean up the methodcaller import in this PR as well if you want, looks like this was the last place it's accessed in here.

jgsawyers avatar Jul 19 '22 01:07 jgsawyers

Wasn't sure if the filter\map were there for legacy reasons. I can clean up the methodcaller import in this PR as well if you want, looks like this was the last place it's accessed in here.

Please feel free to rip methodcaller out of ccp_abc.py. Thank you...

mpenning avatar Jul 20 '22 00:07 mpenning

This PR has automatically been marked stale due to inactivity. It will automatically close unless further action is taken. Please understand that the CiscoConfParse team is not obligated to comment on (or approve) every Pull Request. For more detailed information, please refer to CONTRIBUTING guidance -> https://github.com/mpenning/ciscoconfparse/blob/main/.github/CONTRIBUTING.md

github-actions[bot] avatar Sep 20 '22 03:09 github-actions[bot]