-
Notifications
You must be signed in to change notification settings - Fork 44
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
Get self-update URL from SMT through SUSEconnect (with multiple URLs support) #401
Get self-update URL from SMT through SUSEconnect (with multiple URLs support) #401
Conversation
* master: Update changelog, dependency and version Don't ask twice about multipath bsc#989770
registration server which should be used is determined via: | ||
1. AutoYaST profile ([reg_server element](https://www.suse.com/documentation/sles-12/singlehtml/book_autoyast/book_autoyast.html#CreateProfile.Register)). | ||
2. The `regurl` boot parameter | ||
3. SLP lookup: |
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.
How is the SLP lookup implemented when it comes to AutoYaST? Should be documented too...
Besides the two comments above, I'm fine with this PR (but someone more rubyish should review the code itself). |
@jsrain Thanks! I'll address those documentation issues and I'll ask for a second review. |
The docu looks good to me, thanks! |
2. The `regurl` boot parameter | ||
3. SLP lookup (this behavior applies to regular and AutoYaST installations): | ||
* If one server is found, it will be used automatically. | ||
* If more than one server is found, it will ask the user to choose one. |
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.
Does this mean AutoYaST will require interaction if 2 servers are found via SLP?
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.
Yes, that's it. According to the documentation, when you do a SLP lookup for registration, only 1 server is expected. If more than one is found, the installation will fail. Extracted from AutoYaST docs:
Expects to find a single server. If more than one server is found, the installation will fail. In case > there is more than one registration server available, you need to specify one with reg_server.
On the other hand, maybe we should also honor the slp_discovery
AutoYaST option (so you can disable SLP at all).
The PR title says "multiple URLs" but the changes entry does not mention that. Also, what does it actually mean? Does it mean that YaST will use a single URL but it looks for it in multiple places? Or that one place can specify multiple URLs? Will all of them be combined? Or just the first one that succeeds? I did not find it in SELF_UPDATE.md. |
# * If there's only 1 SMT server, it will be chosen automatically. | ||
# * If there's more than 1 SMT server, it will ask the user to choose one | ||
# | ||
# @return [String,Symbol] Registration URL; :scc if SCC server was selected; |
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 the only method with url
in name that returns a String
, the others return a URI
. What about changing it to return URI
or nil
, like other methods here?
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.
I should know better than suggesting nil
. Make that @return [URI,:scc]
@mvidner From the user's point of view, we only handle 1 URL. However, SCC/SMT (and only SCC/SMT) will return an array of URLs with only 1 element. Initially, it's not likely to change in the near future, but I wanted to prepare the code for the future so we won't have to refactor in case SCC/SMT returns more than 1 URL. Having said that, URLs won't be combined in any way. |
IIUC we will add repos for all of the provided URLs, and they will all be used. So it seems appropriate to document "If SCC/SMT provides multiple update repos, they will all be used." |
@mvidner Yes, I didn't described it correctly. URLs from different sources won't be combined. I'll document it. |
* master: Changes and version UI and UX optimizations Declare textdomain to fix untranslated texts
services = ::Registration::UrlHelpers.slp_discovery | ||
return nil if services.empty? | ||
return :scc if services.empty? | ||
service = | ||
if services.size > 1 | ||
registration_service_from_user(services) | ||
else | ||
services.first | ||
end | ||
return service unless service.respond_to?(:slp_url) |
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.
It seems this statement can return a Yast::SlpServiceClass::Service
: http://www.rubydoc.info/github/yast/yast-registration/master/Registration/UrlHelpers.slp_discovery
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.
Actually slp_discovery always returns something which does respond to slp_url, (at least in master
) so it seems this check can be removed.
LGTM, thank you! |
@mvidner Thanks a lot for your review! |
The installer self-update feature integrates now with SUSE Customer Center (SCC) and Subscription Management Tool (SMT) servers. Until now, there were three different mechanisms to get the URL of the installer updates repository:
SelfUpdate
boot option).control.xml
which is shipped in the media.Now YaST2 is able to ask for the repository URL to SCC/SMT servers. The details of how the URL is determined are documented in the repository.