Server IP : 15.235.198.142 / Your IP : 216.73.216.12 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 : |
""" Functions to be used when running metering jobs """ from uaclient import config from uaclient.api.u.pro.status.is_attached.v1 import _is_attached from uaclient.cli import cli_util from uaclient.contract import UAContractClient @cli_util.assert_lock_file("timer metering job") def metering_enabled_resources(cfg: config.UAConfig) -> bool: # We only run this job if there is no other job running. # The reason for that is to avoid potential conflicts with # auto-attach, attach and enable operations. if not _is_attached(cfg).is_attached: return False contract = UAContractClient(cfg) contract.update_activity_token() return True