capirca_acl debug statement causing a duplicate "log" option on ACLs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue
The rendered cisco ACL has a duplicate "log" option:
! $Date: 2019/12/13 $
no ip access-list extended Internet-ACL-In
ip access-list extended Internet-ACL-In
remark log remaining Traffic
deny ip any any log log
Setup
# cat acl.sls
netacl:
- Internet-ACL-In:
terms:
- term 1000:
name: log remaining Traffic
action: deny
logging: true
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
salt eqc\* capirca.get_filter_config cisco Internet-ACL-In pillar_key=netacl
If I comment out " log.debug(six.text_type(policy_config))" within _get_policy_object, the module only outputs a single "log" option:
! $Date: 2019/12/13 $
no ip access-list extended Internet-ACL-In
ip access-list extended Internet-ACL-In
remark log remaining Traffic
deny ip any any log
exit
The reason for this is that each time the str function for the policy_config object is run, the logging string is appended.
Versions Report
The minion is running on the master.
Salt Version:
Salt: 2019.2.2
Dependency Versions:
cffi: 1.12.3
cherrypy: unknown
dateutil: Not Installed
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.11
ioflo: Not Installed
Jinja2: 2.10
libgit2: 0.26.3
libnacl: Not Installed
M2Crypto: 0.31.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: 1.2.5
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: 3.8.2
pygit2: 0.26.4
Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.6.1810 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-957.5.1.el7.x86_64
system: Linux
version: CentOS Linux 7.6.1810 Core
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with _get_policy_object and the policy_config object's str behavior, then reproduce the issue with the provided salt capirca.get_filter_config command and acl.sls configuration. Trace why rendering appends the logging string more than once; done means the rendered Cisco ACL contains a single log option instead of deny ip any any log log.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100