CCI-MOC / hil

Hardware Isolation Layer, formerly Hardware as a Service
Apache License 2.0
24 stars 54 forks source link

_maintain function in hil.api doesn't do anything. #1035

Open zenhack opened 5 years ago

zenhack commented 5 years ago

I was starting to pick at removing the legacy obm stuff, and came across this:

https://github.com/CCI-MOC/hil/blob/83c8f6df45252013f28f0ef832b934231bfc7aa2/hil/api.py#L1463 The _maintain function validates the config, aborts if a maintenance_project is specified but doesn't exist, and then just returns. The latter half of the function is dead code.

This also raises the concern that what it's supposed to be doing is a bit fiddly with the new structure: power_off just does a redirect now, and when _maintain gets run the obm will be disabled.

Obviously we should make the latter half of the function not-dead code, and we should probably write some integration tests for it. I'm half tempted to just not power off the node automatically; skipping this massively simplifies HIL, and it's functionality that can easily be implemented outside of HIL. It would also be good to be dogfooding this API; we clearly haven't actually been using it thus far :/.

Edit by naved: put the permalink for the line (since after merging #1034 the lines changed).

naved001 commented 5 years ago

skipping this massively simplifies HIL, and it's functionality that can easily be implemented outside of HIL.

Yeah, I am fine with it since it can be implemented outside of HIL.

zenhack commented 5 years ago

Ok. In that case I'll probably just drop the check as part of removing the legacy stuff, and we can do the rest of the fix for this separately.