Skip to content

Conversation

@josephoaks
Copy link

This script is designed for use in a "disconnect" environment. The host server is to do daily exports based on last build of a channel. This script looks at the list of channels, gets the ChannelLastBuildByID and checks if the date is the current date or prior and then exports that channel.

Logging is provided as well to show which channels were updated in that export.

The target server can then rsync the /mnt/export directory and run another script to execute the inter-server-sync import of the exported data.

This script is designed for use in a "disconnect" environment. The host server is to do daily exports based on last build of a channel. This script looks at the list of channels, gets the ChannelLastBuildByID and checks if the date is the current date or prior and then exports that channel.

Logging is provided as well to show which channels were updated in that export. 

The target server can then rsync the `/mnt/export` directory and run another script to execute the inter-server-sync import of the exported data.
@juliogonzalez juliogonzalez requested review from a team and meaksh and removed request for a team April 12, 2024 07:55
Copy link
Member

@meaksh meaksh left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution!

I've added few comments that I hope it helps to get the script in shape to get merged.

Updates from the source since uploading to uyuni-tools, multiple iterations to streamline have occured.

Updates include fixes from comments and further use, which include...
1) script header
2) better path management and configurable parameters
3) use of shutil.rmtree avoiding extra calls to subprocess
4) configurable days for export
5) configurable user/group
6) added the use of mgr-sycn credentials file instead of using username/password in the script.
Copy link
Member

@meaksh meaksh left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! This is looking better now! Still I added some comments after your latest changes, maybe you can have a look.

updated the constants and variables, and changed the order they appear in the script
caught the datetime.date.today()
josephoaks and others added 3 commits April 19, 2024 07:09
Co-authored-by: Pablo Suárez Hernández <[email protected]>
removed the shell=True from the subprocess.run command, missed that from the last commit after updating the command
Fixed the shebang line
fixed the command execution
updated script header to be better formatted and easier to read.
This file is part of the last_update_export.py script put forward. 
This file is for the initial export using the ISSv2 used in a disconnected or air-gapped environment, to do a full export instead of an incremental export as the last_update_export.py, it can also be used to add a new product channel to an air-gapped system.
@mbrookhuis
Copy link
Contributor

Sorry for the late reaction.
Could you review the section for getting the user and password. The script should not been run inside the container but rather outside. Maybe use the configsm.yaml.

@josephoaks
Copy link
Author

These scripts were not designed for the containerized version of SUMA. I will have to work on this.

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.

4 participants