OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
uaclient
/
timer
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 08:41:34 AM
rwxr-xr-x
📄
__init__.py
573 bytes
08/08/2024 02:00:59 PM
rw-r--r--
📁
__pycache__
-
10/28/2024 08:41:34 AM
rwxr-xr-x
📄
metering.py
674 bytes
08/08/2024 02:00:59 PM
rw-r--r--
📄
update_contract_info.py
1.13 KB
08/08/2024 08:21:51 PM
rw-r--r--
📄
update_messaging.py
5.97 KB
08/08/2024 02:00:59 PM
rw-r--r--
Editing: metering.py
Close
""" 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