Add more events when creating a machine with hetzner cloud
What does this PR do?
It adds events and a waiting routing for the creation of cloud machines via hetzner cloud driver to react to them via the reactor system of saltstack.
Commits signed with GPG?
No
@krionbsd
Hello!
I feel like there is already the created-function tested in a unit test. I don't think I am adding something which is not covered by the already written tests from PR #59301
If there is still something wanted, please let me know your ideas of how I can test the events I trigger.
Best regards
@krionbsd
I've just added tests for the timeout and added the check if server is running via a patch of unittest.mock in all the create methods. Anything else todo here?
Hi! I'm your friendly PR bot!
You might be wondering what I'm doing commenting here on your PR.
Yes, as a matter of fact, I am...
I'm just here to help us improve the documentation. I can't respond to questions or anything, but what I can do, I do well!
Okay... so what do you do?
I detect modules that are missing docstrings or "CLI Example" on existing docstrings! When I was created we had a lot of these. The documentation for these modules need some love and attention to make Salt better for our users.
So what does that have to do with my PR?
I noticed that in this PR there are some files changed that have some of these issues. So I'm leaving this comment to let you know your options.
Okay, what are they?
Well, my favorite, is that since you were making changes here I'm hoping that you would be the most familiar with this module and be able to add some other examples or fix any of the reported issues.
If I can, then what?
Well, you can either add them to this PR or add them to another PR. Either way is fine!
Well... what if I can't, or don't want to?
That's also fine! We appreciate all contributions to the Salt Project. If you can't add those other examples, either because you're too busy, or unfamiliar, or you just aren't interested, we still appreciate the contributions that you've made already.
Whatever approach you decide to take, just drop a comment here letting us know!
Detected Issues (click me)
[INFO] Initializing environment for https://github.com/saltstack/pip-tools-compile-impersonate. [INFO] Initializing environment for https://github.com/asottile/pyupgrade. [INFO] Initializing environment for https://github.com/saltstack/pre-commit-remove-import-headers. [INFO] Initializing environment for https://github.com/s0undt3ch/salt-rewrite. [INFO] Initializing environment for https://github.com/timothycrosley/isort. [INFO] Initializing environment for https://github.com/timothycrosley/isort:toml. [INFO] Initializing environment for https://github.com/psf/black. [INFO] Initializing environment for https://github.com/asottile/blacken-docs. [INFO] Initializing environment for https://github.com/asottile/blacken-docs:black==21.7b0. [INFO] Initializing environment for https://github.com/PyCQA/bandit. [INFO] Initializing environment for https://github.com/saltstack/invoke-pre-commit. [INFO] Initializing environment for https://github.com/saltstack/invoke-pre-commit:blessings,distro,jinja2,msgpack,pyyaml. [INFO] Initializing environment for https://github.com/saltstack/mirrors-nox. [INFO] Initializing environment for https://github.com/saltstack/mirrors-nox:pip>=20.2.4,The function 'avail_locations' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'avail_images' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'avail_sizes' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'list_ssh_keys' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'list_nodes_full' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'list_nodes' on 'salt/cloud/clouds/hetzner.py' does not have a docstring The function 'show_instance' on 'salt/cloud/clouds/hetzner.py' does not have a docstring Found 7 errors
Thanks again!
@dithmer can you update the PR to the current version of the master? We are looking into these PR's and it looks like this one has some errors in lint but because of the last time the tests were run we can't see what those errors were.
Taking a look at this right now - I have a question about the test that I want to confirm real quick.
FWIW, I liked that signal/timeout approach so much I opened a PR to turn it into a test fixture: https://github.com/saltstack/salt/pull/62910 You can see how to use it in https://github.com/saltstack/salt/compare/master...waynew:salt:engine-scripts-tests?expand=1
bump @dithmer are you able to come back to this one and implement the feedback and fix up the tests?
bump @dithmer are you able to come back to this one and implement the feedback and fix up the tests?
Hi, I would love to take on it again. I just didn't feel that it was too urgent, cause this issue is already open for about 2 years.
It will probably take my attention during the next week! Have a nice day!
@Ch3LL
Will take a few more days. But I'm on it!
Hi @Ch3LL
I am trying to launch the tests locally but whenever I follow the tutorial for installing (https://docs.saltproject.io/en/master/topics/development/hacking.html#installing-salt-for-development) it installs salt in a version (3000.1) which is not compatible with the tests resulting in an error message:
nox -e 'pytest-zeromq-3(coverage=False)' -- tests/pytests/unit/cloud/clouds/test_hetzner.py
nox > Running session pytest-zeromq-3(coverage=False)
nox > Creating virtual environment (virtualenv) using python3 in .nox/pytest-zeromq-3-coverage-false
nox > This nox session is deprecated, please call 'test-zeromq-3(coverage=False)' instead
nox > Session pytest-zeromq-3(coverage=False) was successful.
nox > Running session test-zeromq-3(coverage=False)
nox > Creating virtual environment (virtualenv) using python3 in .nox/test-zeromq-3-coverage-false
nox > Session test-zeromq-3(coverage=False) was successful.
nox > Running session test-parametrized-3(crypto=None, transport='zeromq', coverage=False)
nox > Creating virtual environment (virtualenv) using python3 in .nox/test-parametrized-3-crypto-none-transport-zeromq-coverage-false
nox > python -m pip install --progress-bar=off -U 'pip>=20.2.4,<21.2' 'setuptools!=50.*,!=51.*,!=52.*,<59' wheel
nox > python -m pip install --progress-bar=off -r requirements/static/ci/py3.10/linux.txt
nox > python -m pytest --rootdir /home/dithmer/dev/salt --log-file-level=debug --show-capture=no -ra -s --showlocals --log-file=/home/dithmer/dev/salt/artifacts/logs/runtests-20221115213630.122146.log --transport=zeromq tests/pytests/unit/cloud/clouds/test_hetzner.py
ERROR: Only salt>=3004 is supported
nox > Command python -m pytest --rootdir /home/dithmer/dev/salt --log-file-level=debug --show-capture=no -ra -s --showlocals --log-file=/home/dithmer/dev/salt/artifacts/logs/runtests-20221115213630.122146.log --transport=zeromq tests/pytests/unit/cloud/clouds/test_hetzner.py failed with exit code 4
nox > Session test-parametrized-3(crypto=None, transport='zeromq', coverage=False) failed.
nox > Ran multiple sessions:
nox > * pytest-zeromq-3(coverage=False): success
nox > * test-zeromq-3(coverage=False): success
nox > * test-parametrized-3(crypto=None, transport='zeromq', coverage=False): failed
What am I missing here? Branch was rebased with master and I've already tried to clean cache/remove the whole virtualenv.
Best regards
Can you ensure you have rebased the lastest changes off of master? I've never seen that before.
Can you ensure you have rebased the lastest changes off of master? I've never seen that before.
Absolutely. Couldnt find out whats the problem yet.
One other thing you can try is to remove your .nox directory to ensure you start with a clean slate.
also @s0undt3ch any ideas at first glance on that error posted above?
Make sure you have all the tags and yes, removing .nox just in case.
But most importantly, the tags.
Closing this due to inactivity. Anyone should feel free to re-open it if they want to see it through to the end in one release cycle.