[bug] command `ci vm create` does not work anymore
Bug
When using a command for creating a vm, we get a python error.
How to reproduce
Here is an example for reproducing the issue:
❯ ci vm create khuynh-sandbox > new_vm.yml
Traceback (most recent call last):
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/.venv/bin/ci", line 29, in <module>
commandline.handle()
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/commandline.py", line 173, in handle
func(config, args)
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/commandline.py", line 228, in do_action
action(self, *args)
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/vms.py", line 201, in create
connection.portal.projects[project].vms.create()
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/api/portal.py", line 814, in create
return Vms.Create(self.project)
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/api/portal.py", line 751, in __init__
self.__offerings = self.__enumerate_all_offerings()
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/api/portal.py", line 791, in __enumerate_all_offerings
"computer_offerings": enumerate_options(
File "/home/khuynh/workspace/devlog/tools/ci-cmdline/src/api/portal.py", line 770, in enumerate_options
offers = page.body.find("select", {"id": option_id}).find_all(
AttributeError: 'NoneType' object has no attribute 'find_all'
Root cause
portal.py
tries to enumerate computing offerings using:
"computer_offerings": enumerate_options(
"newSlave_computerOffering"
),
However, computerOffering does not exist anymore since changes in the web portal (cf. https://gitlab.inria.fr/inria-ci/ci-portal/-/commit/2b7aa4bca56e7d516743aa9f4aa21d5db94ae631#41ab00bf5a5fccbf352e23f42cd8e4799fbb074b)
Solution
Make modifications to support the new form of the web portal