Closed ianballou closed 6 years ago
Naved and I talked about some options for error checking the POST response. We suggest that even if the POST fails, the node still be taken away from the user's project and put in the maintenance pool. Then, an error will be logged for the admin to see.
We also thought it would be helpful to add a configurable for powering off the node when it gets moved into the maintenance pool. This would be for users who don't want to setup a full-fledged service but still have basic maintenance done.
As for testing, would it be appropriate to have my tests in a new file? The API test is getting rather large.
we discussed in the HIL meeting that it would be a good idea to provide a sample service that would take the post request and do a subsequent detach_node that other's could build on.
After some discussion with @naved001, we decided it would probably be more appropriate to add the sample service in a second pull request.
One issue came up when writing the tests: running project_detach_node
with maintenance enabled requires a server to POST to. As a placeholder I put a (real) dummy website that will take the POST. Since this might not be appropriate for unit tests, we can either keep the POST out of the tests or try using requests_mock
.
Are there any other options for the dummy POST that would be worth exploring?
I discovered that my maintenance pool test is causing the cli.py
integration test to fail somehow, which I will be investigating.
Edit: now fixed.
Works for me, merging.
project_detach_node
will move the node to the maintenance project and POST to the maintenance service URL.examples/hil.cfg
has been updated with the new config options.pooldocs/maintenance-pool
introduces the maintenance pool, shows an example use-case, and describes the configuration process.