WPA-PSK and WPA-EAP are supported. Uses existing 802.1x features of the role.
Added extra functionality to ArgValidatorStr to enforce a min and max length.
Ethtool features should use underscores instead of dashes. A
warning shows in case dashes used, and it fails if underscore and dashes are
mixed. Unit tests and integration tests have been added. Since nm already
needed underscores, the string processing that was made in nm_provider is now
unneeded and therefore removed.
Now the contribution document has some steps to facilitate to get into the
project's workflow for new contributors. It also contains the code
structure and how to use the CI testing of the project and basic info about git
configuration. A small reference to the contributing document has been added to
the readme.
Signed-off-by: Elvira Garcia Ruiz <elviragr@riseup.net>
To avoid conflicts with other roles, it is recomended to prefix all variables
that are only used internally with '__' and the name of the role ('__network_').
This patch implements the ETHTOOL_GPERMADDR command in order to retrieve
the permanent address from ethtool instead using command line tool.
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
According to PEP8 [1], the import are always put at the top of the file,
just after any module comments and docstrings, and before module globals
and constants.
[1] https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
network-scripts needs dbus-tools to be present to properly communciate
with NetworkManager but the dependency is missing and dbus-tools is not
installed on the CloudBase images. Therefore, ensure that it is present.
There was no documentation of the supported bond options.
Added supported options to the README.md and added an example of a
simple bond with both of those options.
Logs are now separed by severity level. Warnings and failures are the only logs
that appear now on the output. All logs are saved into a new json parameter
called "stderr" that is later shown on a different task. In case of
failure, all logs are shown as output. Tests have been created and modified in
order to assure that this feature works.
Signed-off-by: Elvira Garcia Ruiz <elviragr@riseup.net>
As reported in https://github.com/tox-dev/tox-travis/issues/147, the
python factor in tox-travis needs to match the Travis python environment
and not the python version. Therefore, add a separate line.
Some tests were getting the following error:
```
Unexpected templating type error occurred on ({{
network_connections |
json_query('[*][ieee802_1x]') | flatten | count > 0 }}): 'NoneType'
object is not iterable"
```
In general it is better to avoid the use of `json_query` and use
the older built-in jinaj2 filters such as `selectattr`, unless you
need to perform a complex query of complex json data. In this
case, not sure what the problem was with the input json, but
using `selectattr` seems to have fixed it.
Role now supports validating the domain name of the EAP server certificate.
Regenerated the CA certificate as the private key for the original CA has been lost.
Updated test certificates to include a domain name in the CN so the domain-suffix-match
feature can be tested.
Instead of determining the non-default provider, run all integration
tests explicitly for both providers or only the providers that are
required. Since Ansible does not allow to pass variables to playbooks
imported with `import_playbook` to select another playbook to import,
generate the files instead of using a shared playbook like
`run_with_nm.yml` or `run_with_initscripts.yml`.
tox supports a `[flake8]` section, so move the default
settings there rather than having them passed in on the
command line. Projects can still override flake8 arguments
by using `RUN_FLAKE8_EXTRA_ARGS` in `.travis/config.sh`
Signed-off-by: Till Maas <opensource@till.name>
Removed `mock` from the `testenv` `deps`.
Added `mock` to the template pytest_extra_requirements.txt,
commented out. Projects such as network that need it can uncomment it.
These changes don't directly affect network, or don't actually
change the behavior of existing code that network uses (coveralls),
but are intended to sync with the latest template code.
Adds `LSR_PUBLISH_COVERAGE=normal` to `.travis/config.sh` because
network wants to publish coverage normally (as opposed to `strict`
or not at all).
This does not directly affect network because network has its own
solution for dealing with testing/linting module_utils code, but
it gets network to feature/code parity with the template and
other repos.
Defines a shell function in utils.sh - lsr_setup_module_utils -
that allows configuring a tox venv installed ansible to have
the repo module_utils code in the default pythonpath for the
venv, which allows testing and linting the module_utils code
without having to otherwise munge or mock the pythonpath.
Projects needing this functionality can set in `.travis/config.sh`
the variable `RUN_PYTEST_SETUP_MODULE_UTILS` to setup
module_utils/ for pytest, and `RUN_PYLINT_SETUP_MODULE_UTILS`
to setup module_utils/ for pylint.
NOTE: I don't think this commit directly affects network, since
network doesn't use any of these - this PR is more for parity
with template and other repos.
Centralize the setting of `ME` and `TOPDIR` in utils.sh
Add support for `RUN_FLAKE8_EXTRA_ARGS` and `RUN_BLACK_EXTRA_ARGS`