netutils
netutils copied to clipboard
reformatting community-list community numbers to colon format
Environment
- netutils version: 1.0.0
Proposed Functionality
Use Case
ip community-list FROM_LOCAL_ROUTER_ID permit 1684594711
# CONVERTS TO THE BELOW
ip community-list FROM_LOCAL_ROUTER_ID permit 25704:57367
jinja example to help with creating it.
{% macro comm_no_colon(community) %}
{{ community // 2**16 }}:{{ community % 2**16 }}
{% endmacro %}
ip community-list FROM_LOCAL_ROUTER_ID permit {{ comm_no_colon(1684594711) }}
add int_to_asn function in asn.py.