Hello Experts,
This is my first time filing of bug so please pardon me for any errors.
1. Issue occurs on the following rolling version:
$ show version
Version: VyOS 1.2.0-rolling+201904260337
Built by: autobuild@vyos.net
Built on: Fri 26 Apr 2019 03:37 UTC
Build ID: f5be1973-3184-427e-9024-e6972c144512
Architecture: x86_64
Boot via: installed image
System type: bare metal
Hardware vendor: Vyatta, Inc.
Hardware model: Vyatta 600
Hardware S/N: Unknown
Hardware UUID: Unknown
Copyright: VyOS maintainers and contributors
2. The following configuration does not get committed:
vyos# compare
[edit system]
+syslog {
+ global {
+ archive {
+ file 60
+ size 2048
+ }
+ facility all {
+ level debug
+ }
+ facility protocols {
+ level debug
+ }
+ }
+}
3. When trying to commit the above configuration, following error throws up:
vyos# commit
[ system syslog ]
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/syslog.py", line 293, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/syslog.py", line 282, in apply if not os.path.exits('/var/run/rsyslogd.pid'): <<<<< error in "os.path.exits" attribute in line 282
AttributeError: 'module' object has no attribute 'exits'
4. The relevant section of code in the python file "/usr/libexec/vyos/conf_mode/syslog.py" is:
def apply(c):
if not os.path.exits('/var/run/rsyslogd.pid'): <<<<< attribute error in "os.path.exits" on line 282 os.system("sudo systemctl start rsyslog >/dev/null") else: os.system("sudo systemctl restart rsyslog >/dev/null")
5. Referring to module definitions in python at https://docs.python.org/2/library/os.path.html, I observed that "os.path.exists" is the correct module attribute name.
6. I made the following correction in "/usr/libexec/vyos/conf_mode/syslog.py" python file:
def apply(c):
if not os.path.exists('/var/run/rsyslogd.pid'): <<<<< "os.path.exits" changed to "os.path.exists" on line 282 os.system("sudo systemctl start rsyslog >/dev/null") else: os.system("sudo systemctl restart rsyslog >/dev/null")
7. After the changed, I was able to commit the configuration defined in Step 2:
vyos# compare
[edit system]
+syslog {
+ global {
+ archive {
+ file 60
+ size 2048
+ }
+ facility all {
+ level debug
+ }
+ facility protocols {
+ level debug
+ }
+ }
+}
[edit]
vyos# commit
[edit]
vyos#
I am not a developer (totally new to development) but I would like contribute to the community wherever I can.
If anyone can guide me on how to make these available in the nightly builds, I can start contributing immediately.
Thank You
Ray