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
Forbid de-registration for on-demand Public Cloud instances #431
Conversation
aad5385
to
350f805
Compare
350f805
to
6f26802
Compare
Well Done! Your tests are still passing. |
if File.exist?('/usr/sbin/registercloudguest') | ||
raise UnsupportedOperation, | ||
'De-registration is disabled for on-demand instances. Use `registercloudguest --clean` instead.' | ||
end |
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.
Did you check how deregistration with yast will fail in this case?
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.
@digitaltom I don't think Yast has de-registration functionality at all.
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.
https://github.com/yast/yast-registration/blob/master/src/lib/registration/ui/registered_system_dialog.rb#L43-L44 -- this advice sounds weird.
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.
Hmm that message assumes that users have at least cloud-regionsrv-client 9.0.6. I suppose it is fair to assume that someone that picks up the new version of SUSEConnect also updated the cloud-regionsrv-client package. I am OK making the connection, just wanted to note that it exists.
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.
@rjschwei yep, I though about this as well, but the alternative to --clean
would be manual clean up and I'm not sure how explain that in a short error message.
But as long as modules aren't removed, I guess this should be fine.
if File.exist?('/usr/sbin/registercloudguest') | ||
raise UnsupportedOperation, | ||
'De-registration is disabled for on-demand instances. Use `registercloudguest --clean` instead.' | ||
end |
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.
Hmm that message assumes that users have at least cloud-regionsrv-client 9.0.6. I suppose it is fair to assume that someone that picks up the new version of SUSEConnect also updated the cloud-regionsrv-client package. I am OK making the connection, just wanted to note that it exists.
|
||
context 'when running on on-demand instance' do | ||
before do | ||
allow(File).to receive(:exist?).and_call_original |
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.
Shouldn't this be treated as an expect
?
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.
Depends on your view on whether expectations should be allowed in before
block. Rubocop complains about that, though.
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.
If all the other comments are addressed, then lgtm.
De-registration removes product release packages, which prevents automatic re-registration of modules.
registercloudguest
should be used on on-demand instances instead.