import logging from uaclient import contract, messages, util from uaclient.config import UAConfig from uaclient.files import notices from uaclient.files.notices import Notice LOG = logging.getLogger(__name__) def update_contract_info(cfg: UAConfig) -> bool: if 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: with util.disable_log_to_console(): err_msg = messages.UPDATE_CHECK_CONTRACT_FAILURE.format( reason=str(e) ) LOG.warning(err_msg) return False return True
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 0 B | 0644 |
|
metering.py | File | 595 B | 0644 |
|
update_contract_info.py | File | 852 B | 0644 |
|
update_messaging.py | File | 6.38 KB | 0644 |
|