summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2020-04-12template: T2230: use render to generate templatesThomas Mangin
convert all call to jinja to use template.render
2020-04-12tunnel: T2236: missed mtu command on all tunnelsThomas Mangin
2020-04-12Merge pull request #334 from thomas-mangin/T31Christian Poessinger
ifconfig: T31: add skeleton VTI and input classes
2020-04-12vyos.util: openvpn: migrate to chmod_600()Christian Poessinger
2020-04-12ifconfig: T31: add skeleton VTI and input classesThomas Mangin
also add a function to Section which provides a list of reserved names
2020-04-12vyos.util: rename chmod_x() -> chmod_755()Christian Poessinger
2020-04-11Merge pull request #329 from thomas-mangin/T2226Christian Poessinger
util: T2226: improvement and fixes
2020-04-11completion: T2238: use interface dataThomas Mangin
Use the data in the default dict of the interface to generate the output of list interface.
2020-04-11ifconfig: T2223: rename Section.listing to interfacesThomas Mangin
update all code using the API. Interface.interfaces() could be used but the code was change to use Section.interfaces() which make more sense when reading it.
2020-04-11ifconfig: T2223: rename Register to SectionThomas Mangin
While the class does indeed all the registration, it work is really to map classes to interface section. ie: interface ethernet -> EthernetIf Therefore it can also list which interface are from which type, therefore the name change. Other function name will also be renamed as a consequence
2020-04-11util: T2226: prevent string over bytes for inputThomas Mangin
2020-04-11util: T2205: convert remote to use cmdThomas Mangin
2020-04-11util: T2226: passthrough for stderr, fix input, always newlineThomas Mangin
Change the code to let stderr passthrough to the screen as it is the behaviout of os.system and subprocess.call/check_out The input feature was not working and was fixed Also always convert '\r\n' to '\n'
2020-04-11Merge pull request #326 from thomas-mangin/T2265Christian Poessinger
dhcp: T2265: refactor DHCP class
2020-04-11dhcp: T2230: use external template filesThomas Mangin
2020-04-11template: T2230: helper to generate templatesThomas Mangin
Currently the pattern is to import jinja2 and re-generate the template in every file. Dimitriy reported a reduction in performance (1s) when commiting. This code provide an helper function which caches the Environment and template renderer, and can generate template from one line (instead of the few currently)
2020-04-11dhcp: T2265: refactor DHCP classThomas Mangin
Break the code between v4 and v6, remove need for getter/setter as they are just exposing the underlying dict. Move FixedDict from tunnel code and expose it to other part so it can be used to prevent accidental change to the dhcp option if no default exists already.
2020-04-10util: T2253: fix translation of subprocess.check_output to cmdJohn Estabrook
2020-04-10Revert "Revert "util: T2226: rewrite remote function helpers to use cmd""John Estabrook
This reverts commit 10717c6a3cdf7da7025b03c1abdbd813b4970b19.
2020-04-09vxlan: T2172: add source-address optionChristian Poessinger
This is a base requirement for l2vpn evpn. When source-address is configured, the option "local <source-addr> nolearning" is appended when creating the interface as mentioned here: https://vincent.bernat.ch/en/blog/2017-vxlan-bgp-evpn
2020-04-09Merge branch 'vxlan' of github.com:c-po/vyos-1x into currentChristian Poessinger
* 'vxlan' of github.com:c-po/vyos-1x: vxlan: pseudo-ethernet: T2260: convert link nodes to source-interface wireguard: T2206: fix comment in migration script pppoe: enable Jinja2 trim_blocks
2020-04-09vxlan: pseudo-ethernet: T2260: convert link nodes to source-interfaceChristian Poessinger
2020-04-09util: T2226: os.system was wrongly converted to runThomas Mangin
os.system does print the ouput of the command, run() does not. A new function called call() does the printing and return the error code.
2020-04-09util: T2205: do not display debuging when it is not setThomas Mangin
2020-04-09Merge pull request #316 from thomas-mangin/T2242Christian Poessinger
import: T2242: remove all import *
2020-04-09Merge pull request #317 from thomas-mangin/T2028-remoteChristian Poessinger
tunnel: T2028: fix remote and registration
2020-04-09Merge pull request #314 from thomas-mangin/T2186Christian Poessinger
airbag: T2186: report friendly user message and log to syslog
2020-04-08tunnel: T2028: register the _Tunnel classThomas Mangin
All interface classes register themselves so that we can figure out from an interface name what class is responsible for its creation. In the case of Tunnel, it is not the case as multiple different interfaces are sharing the same "tun" prefix. Still many operations are the same and it should be done.
2020-04-08Revert "util: T2226: rewrite remote function helpers to use cmd"John Estabrook
This reverts commit 7219d4013814a55c4eeaf36b7a36d5e8076d09f0.
2020-04-08vyos.util: introduce chmod_750() for files/directoriesChristian Poessinger
2020-04-08vyos-util: rename chown_file() > chown()Christian Poessinger
... to make it clear also directories can be chown(-ed)
2020-04-08logging: T2186: cosmetic changesThomas Mangin
2020-04-08import: T2242: remove all import *Thomas Mangin
2020-04-08logging: T2186: Initial implementation of loggingThomas Mangin
All messages sent to stderr are now logged to syslog. Also should a raise statement not be handled by the program, a friendlier message is sent to the user (with the trace to syslog) It provide a new debug option: /tmp/vyos.developer.debug when the file exists and the code raise without being caught up the program will automatically fall into pdb port-morterm mode allowing to investigate the reason for the failure
2020-04-08version: T2186: do not raise if not version infoThomas Mangin
The code attempted to access the information on the file system During the package build this is not available, therefore the code was modified to return empty object when no data is there
2020-04-07bridge: T2232: prevent deletion of enslaved interfacesChristian Poessinger
Interfaces enslaved to a bridge are not allowed to be deleted. If an interface is deleted from the config but it is still enslaved to a bridge will cause a configuration error on the subsequent boot.
2020-04-07vyos.util: T2226: add proper commentsChristian Poessinger
2020-04-06util: T2226: remove all references to subprocess_cmdThomas Mangin
2020-04-06util: T2226: rewrite util to use cmdThomas Mangin
2020-04-06util: T2226: rewrite remote function helpers to use cmdThomas Mangin
2020-04-06util: T2226: rewrite WireGuardIf to use cmdThomas Mangin
2020-04-06util: T2226: rewrite EthernetIf.feature to use cmdThomas Mangin
2020-04-06util: T2226: rewrite make_password_hash to use cmdThomas Mangin
2020-04-06util: T2226: improve popen, cmd and add runThomas Mangin
improves open and cmd adds a new help function run. the extra optional arguments provide all the features of subprocess used by every module of VyOS. popen matches closely subprocess.Popen cmd matches closely subprocess.check_output run matches closely subprocess.call and os.system popen returns the string and errord code cmd returns the string and raise on error (the class can be defined the default is OSError) run returns the return code of the command the options are: shell=None, the code auto-detect is a shell is required decode=None, use .decode() otherwise the encoding will be used env=None, universal_newlines=None: as per subprocess.Popen input=None, timeout=None, stdout=PIPE, stderr=STDOUT, as per Popen.communicate
2020-04-05ifconfig: l2tpv3: T1823: fix remaining errors in config syntaxChristian Poessinger
Commit b5310b0 ("ifconfig: l2tpv3: T1823: fix configuration build syntax") did not cover all parts of the l2tpv3 config. Some parts when e.g. adjusting l2tpv3 addresses after the tunnel was created did fail with the same error. This has been fixed.
2020-04-04vyos.util: rename chmod_x_file() to chmod_x()Christian Poessinger
Now both files and directories are supported.
2020-04-04Merge pull request #302 from thomas-mangin/T2190Christian Poessinger
ifconfig: T2190: option to prevent Interface creation
2020-04-04Merge pull request #299 from thomas-mangin/T2205Christian Poessinger
ifconfig: T2205: silence ethtool harmless failures
2020-04-04ifconfig: T2190: option to prevent Interface creationThomas Mangin
a new option was added to the Interface class "create". By default the value is set to True, and when an instance of the class is created and the underlying interface does not exists, the class will create it. If the option "create" is set to False, the interface will not be created and instead the class will raise an error when it is instantiated.
2020-04-04ifconfig: T2205: silence ethtool harmless failuresThomas Mangin
Not all interface are capable of all features. Since commands are now checked for valid completion, ethtool command failure must be ignored.