Page MenuHomePhabricator

Python environment lacks definition of vyos_libexec_dir when calling os.system()
In progress, NormalPublicBUG


Rewriting the SNMP configuration as XML/Python requires that the running VyOS configuration is altered by the python script. This is aweful.

The reason is that if a user specifies a plaintext password it will be converted to an encrypted one during SNMP startup. Later this encrypted pasword is re-read and set as encrypted-key in the running config whereas the plaintext-key node is deleted.


os.system('/opt/vyatta/sbin/my_delete service snmp v3 user "nms" auth plaintext-key')

Resulted in:

sh: / No such file or directory

The available environment has been extracted using os.system('env')

The current workaround in is more than ugly (definition of the environment variable before calling the script)


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close
c-po created this task.Jun 5 2018, 7:43 PM
c-po updated the task description. (Show Details)Jun 5 2018, 7:49 PM
syncer triaged this task as Low priority.Jun 10 2018, 2:24 AM
dmbaturin added a subscriber: dmbaturin.

@c-po You've found a workaround, right?

c-po added a comment.Sep 3 2018, 5:07 AM

Yes, just pass the variable on calls to os.system()

c-po added a comment.Sep 3 2018, 12:53 PM

@dmbaturin the "workaround" and implementation is IMHO super bad ( as it uses /opt/vyatta/sbin/my_set or /opt/vyatta/sbin/my_delete.

Can't we use vyos.configtree in a Python script to replace those bad shell calls? I think this would be the best solution!

In other words, does vyos.configtree support the effective configuration?

pasik added a subscriber: pasik.Nov 4 2018, 11:24 AM
syncer assigned this task to dmbaturin.Fri, Feb 8, 12:03 AM
syncer changed the task status from Open to In progress.
syncer raised the priority of this task from Low to Normal.