Page MenuHomeVyOS Platform

equuleus: Testing: vyos-1x: syntax checking python scripts in PR
Open, Requires assessmentPublic


In the past there have been quite a few tickets regarding python syntax errors on scripts rewritten to python.
To make a quickfix on some of these faults we could make a Jenkins step that executes: python3 -m compileall -q . to do a offline compile of the python files.

as for writing this tasks we have these faults in the repository:

*** Error compiling './src/conf_mode/'...
Sorry: IndentationError: unindent does not match any outer indentation level (, line 635)
*** Error compiling './src/conf_mode/'...
  File "./src/conf_mode/", line 130
    or peth['ipv6_autoconf'] ) ):
SyntaxError: invalid syntax

*** Error compiling './src/conf_mode/'...
  File "./src/conf_mode/", line 172
    return None
SyntaxError: invalid syntax


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

runar created this object in space S1 VyOS Public.

Wouldn't it be better to add it to the vyos-1x Makefile so we could test it ourselves, before committing, making a PR, it being merged, and only then figuring out it's a problem?

The fix for the error for openvpn is already waiting in PR since yesterday, fix for pseudo-ethernet and vxlan will be ready right now.

I would also suggest doing the same using github actions so that on push to your local repository to get a warning from github.

It seems that github has special rules for the .github file and that no PR can be done for it:

This does not compile python scripts without a .py extension (there are several in src/services, src/utils that have #!/usr/bin/env python3)

Many scripts also so do implement if name == โ€œmainโ€