-
Notifications
You must be signed in to change notification settings - Fork 75
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
api: u.pro.services.enable.v1 (SC-1619) #2904
Conversation
Jira: SC-1619 GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references) Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references) Documentation: The changes in this PR do require documentation changes, but those were not addressed yet. 👍 this comment to confirm that this is correct. |
🌎 This PR changes translatable messages. 🌏 Please select which scenarios apply. For further explanation, please read our policy on message changes.
|
421cfa9
to
b5f5e7c
Compare
d922a95
to
3fdd0cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nits here and there, but overall lgtm
debian/po/pt_BR.po
Outdated
@@ -889,6 +889,7 @@ msgid "an error while reaching {url}" | |||
msgstr "um error ao acessar {url}" | |||
|
|||
#: ../../uaclient/messages/__init__.py:414 | |||
#: ../../uaclient/messages/__init__.py:1918 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate message - should we reuse it?
debian/po/pt_BR.po
Outdated
#: ../../uaclient/messages/__init__.py:2558 | ||
#, fuzzy | ||
msgid "The operation is not supported" | ||
msgstr "A atualização ainda não está instalada" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"A operação não é suportada"
features/api_enable.feature
Outdated
"reboot_required": false | ||
} | ||
""" | ||
When I run shell command `pro api u.pro.status.enabled_services.v1 | jq .data.attributes.enabled_services ` with sudo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recently landed a PR which brings simpler steps, like verify that esm-infra is enabled
- we could use that here.
features/api_enable.feature
Outdated
|
||
Scenario Outline: u.pro.services.enable.v1 container services | ||
Given a `<release>` `<machine_type>` machine with ubuntu-advantage-tools installed | ||
When I run `apt-get update` with sudo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recently landed a pr which implements When I apt update
- we could use it here; same for similar calls
features/api_enable.feature
Outdated
""" | ||
Examples: | ||
| release | machine_type | | ||
| jammy | lxd-vm | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cursed missing newline
) -> EnableResult: | ||
event.set_event_mode(event_logger.EventLoggerMode.JSON) | ||
|
||
if not _is_attached(cfg).is_attached: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also handle the situation where a user is running as non-root
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added!
3fdd0cc
to
b3db195
Compare
b3db195
to
8a59700
Compare
@renanrodrigo @lucasmoura updated! |
I'm forging ahead with #2908 and will likely refactor some of this, break into new PRs, etc. So I'll close this since it is just cluttering up our PR list |
Why is this needed?
This adds an API for enabling services, which will be useful for other software wanting to enable pro services in a dependable way.
Test Steps
New behave tests should pass
Checklist
Does this PR require extra reviews?