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

Support systems with transactional updates #156

Merged
merged 7 commits into from May 9, 2024
Merged

Conversation

rjschwei
Copy link
Contributor

@rjschwei rjschwei commented May 9, 2024

On systems that have a read-only root filesystem and transactional updates SUSEConnect disables itself and we need to call the transactional-update register command in order to complete system registration. This is not true for transactional-update systems that have a read-write root filesystem. Therefore we need to look at the mount options of the filesystem. On a read-only setup zypper is called to work on a specific directory and we have to take this into account when handling credentials.

If base product registration fails we swallow the error message and it is
only available in the log file. We correctly exit with error code 1. Provide
the error message we get from the underlying registration tool used on stderr.
On SUSE Micro systems with a RO root filesystem we need to use the
transactional-update register command to complete the registration.
SUSEConnect disables itself in this situation and produces and error.

Signed-off-by: Robert Schweikert <rjschwei@suse.com>
If zypper is instructed to operate on a different root with the "--root"
argument the credentials are also expected to be found in this seperate
root tree. WE need to accomodate this redirection.
When running the tests with pytest only we need to properly set the path to
the current location to find the modules we want to import. While the path
calculation was alreday part of the test, the created path was not properly
inserted into the environment.
To support a transactional system we need to look at the process table to
see if zypper is operating on a directory other than the default root path.
A new function was added to retrieve the target path form the zypper
command line. Test the various command line options.
usr/sbin/registercloudguest Outdated Show resolved Hide resolved
THe command generation for registration had to be split, no need to have a
variable for a fixed value when it is used only once.
@rjschwei rjschwei requested a review from jesusbv May 9, 2024 15:15
Copy link
Contributor

@apozsuse apozsuse left a comment

Choose a reason for hiding this comment

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

Other than the minor comments, LGTM

@rjschwei rjschwei merged commit 9471db2 into master May 9, 2024
1 check passed
@rjschwei rjschwei deleted the transactSupport branch May 9, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants