zypper operations¶
- class reemote.operations.zypper.update.Update(guard: bool = True, sudo: bool = False, su: bool = False)[source]¶
Bases:
Operation_updateA class to manage package update operations on a remote system using zypper.
This class provides functionality to update package lists on openSUSE/SUSE systems using the zypper package manager. It allows configuration of execution privileges and safety guards for package update operations.
- guard¶
If False the commands will not be executed.
- Type:
bool
- sudo¶
If True, the commands will be executed with sudo privileges.
- Type:
bool
- su¶
If True, the commands will be executed with su privileges.
- Type:
bool
Examples:
# Update package lists on all hosts r = yield Update() # Check if the operation was successful if r.cp.return_code == 0: print("Package lists updated successfully")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution.
Notes
Uses zypper update command internally for updating package lists.
Inherits from Operation_update base class.
This operation only updates the package lists but does not upgrade installed packages.
- class reemote.operations.zypper.upgrade.Upgrade(guard: bool = True, sudo: bool = False, su: bool = False)[source]¶
Bases:
Operation_upgradeA class to manage package upgrade operations on a remote system using zypper.
This class provides functionality to upgrade installed packages on openSUSE/SUSE systems using the zypper package manager. It allows configuration of execution privileges and safety guards for package upgrade operations.
- guard¶
If False the commands will not be executed.
- Type:
bool
- sudo¶
If True, the commands will be executed with sudo privileges.
- Type:
bool
- su¶
If True, the commands will be executed with su privileges.
- Type:
bool
Examples:
# Upgrade installed packages on all hosts r = yield Upgrade() # Check if the operation was successful if r.cp.return_code == 0: print("Packages upgraded successfully")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution.
Notes
Uses zypper upgrade command internally for upgrading packages.
Inherits from [Operation_upgrade](file:///home/kim/reemote/reemote/operation_upgrade.py#L0-L58) base class.
This operation upgrades installed packages to their latest versions.
- class reemote.operations.zypper.packages.Packages(packages: List[str], present: bool, guard: bool = True, sudo: bool = False, su: bool = False)[source]¶
Bases:
Operation_packagesA class to manage package operations on a remote system using zypper.
This class provides functionality to install or remove packages on openSUSE/SUSE systems using the zypper package manager. It allows configuration of execution privileges and safety guards for package operations.
- packages¶
List of package names to install or remove.
- Type:
List[str]
- present¶
If True, packages will be installed; if False, packages will be removed.
- Type:
bool
- guard¶
If False the commands will not be executed.
- Type:
bool
- sudo¶
If True, the commands will be executed with sudo privileges.
- Type:
bool
- su¶
If True, the commands will be executed with su privileges.
- Type:
bool
Examples:
# Install packages on all hosts r = yield Packages(["nginx", "curl"], present=True) # Check if the operation was successful if r.cp.return_code == 0: print("Packages installed successfully") # Remove packages on all hosts r = yield Packages(["nginx", "curl"], present=False) # Check if the operation was successful if r.cp.return_code == 0: print("Packages removed successfully")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution.
Notes
Commands are constructed based on the present flag to determine whether to install or remove packages.
Uses zypper install and zypper remove commands internally for package management.
Inherits from Operation_packages base class.
- get_packages()[source]¶
Retrieve the list of installed packages. Subclasses must implement this method.