Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source: add a default value for search_drivers in POST /source #1287

Merged
merged 1 commit into from Apr 29, 2022

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Apr 28, 2022

For backward compatibility reasons with the desktop installer implementation, we now provide a default value (i.e., false) for the new search_drivers parameter in /source.

CC @jpnurmi

@ogayot ogayot requested review from jpnurmi and dbungert April 28, 2022 17:12
Copy link
Collaborator

@dbungert dbungert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running this through quick api test, the argument is still required.

  File "./v2", line 152, in auto_server_install
    await inst.post('/source', source_id='ubuntu-server')
  File "./v2", line 83, in post
    return await self.request('POST', query, data, **kwargs)
  File "./v2", line 110, in request
    raise ClientException(content)
__main__.ClientException: Traceback (most recent call last):
  File "/home/dbungert/dev/github/canonical/subiquity/subiquity/common/api/server.py", line 115, in handler
    raise TypeError(
TypeError: missing required argument "search_drivers"

@ogayot
Copy link
Member Author

ogayot commented Apr 28, 2022

Running this through quick api test, the argument is still required.

  File "./v2", line 152, in auto_server_install
    await inst.post('/source', source_id='ubuntu-server')
  File "./v2", line 83, in post
    return await self.request('POST', query, data, **kwargs)
  File "./v2", line 110, in request
    raise ClientException(content)
__main__.ClientException: Traceback (most recent call last):
  File "/home/dbungert/dev/github/canonical/subiquity/subiquity/common/api/server.py", line 115, in handler
    raise TypeError(
TypeError: missing required argument "search_drivers"

Well, that does not sound right :( The following command succeeds and does what it should do.

$ curl --unix-socket .subiquity/socket -X POST http://a/source'?source_id="ubuntu-server"'

I'm investigating.

Copy link
Collaborator

@dbungert dbungert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, false alarm, my test was invalid.

@ogayot
Copy link
Member Author

ogayot commented Apr 28, 2022

Sorry, false alarm, my test was invalid.

No problem. I took the opportunity to add tests for it following your comment.

For backward compatibility reasons with the desktop installer
implementation, we now provide a default value (i.e., false) for the new
search_drivers parameter in /source.

Added non-regressions test for it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Copy link
Collaborator

@dbungert dbungert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mwhudson
Copy link
Collaborator

Thanks from me too

@mwhudson mwhudson merged commit a0906aa into canonical:main Apr 29, 2022
@ogayot ogayot deleted the optional-search_drivers branch April 29, 2022 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants