__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
"""
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
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 573 B | 0644 |
|
| metering.py | File | 674 B | 0644 |
|
| update_messaging.py | File | 5.97 KB | 0644 |
|