Server IP : 184.154.167.98 / Your IP : 18.222.182.226 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/cloudinit/distros/package_management/ |
Upload File : |
# This file is part of cloud-init. See LICENSE file for license information. import logging from typing import Iterable, List from cloudinit import subp, util from cloudinit.distros.package_management.package_manager import ( PackageManager, UninstalledPackages, ) LOG = logging.getLogger(__name__) class Snap(PackageManager): name = "snap" def update_package_sources(self): pass def install_packages(self, pkglist: Iterable) -> UninstalledPackages: # Snap doesn't provide us with a mechanism to know which packages # are available or have failed, so install one at a time pkglist = util.expand_package_list("%s=%s", list(pkglist)) failed: List[str] = [] for pkg in pkglist: try: subp.subp(["snap", "install"] + pkg.split("=", 1)) except subp.ProcessExecutionError: failed.append(pkg) LOG.info("Failed to 'snap install %s'!", pkg) return failed @staticmethod def upgrade_packages(): subp.subp(["snap", "refresh"])