Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.217.105
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
ubuntu-advantage /
Delete
Unzip
Name
Size
Permission
Date
Action
add_esm_snapshot_auth.py
1.88
KB
-rw-r--r--
2026-04-08 03:24
apt-esm-json-hook
50.32
KB
-rwxr-xr-x
2026-07-06 22:36
apt_news.py
565
B
-rw-r--r--
2026-04-08 03:24
auto_attach.py
3.68
KB
-rw-r--r--
2026-04-08 03:24
cloud-id-shim.sh
500
B
-rwxr-xr-x
2026-04-08 03:24
convert_list_to_deb822.py
2.37
KB
-rw-r--r--
2026-04-08 03:24
daemon.py
2.49
KB
-rw-r--r--
2026-04-08 03:24
esm_cache.py
491
B
-rwxr-xr-x
2026-04-08 03:24
migrate_user_config.py
5.37
KB
-rw-r--r--
2026-04-08 03:24
patch_status_json.py
2.47
KB
-rwxr-xr-x
2026-04-08 03:24
postinst-migrations.sh
3.53
KB
-rwxr-xr-x
2026-04-08 03:24
reboot_cmds.py
4.9
KB
-rw-r--r--
2026-04-08 03:24
timer.py
5.98
KB
-rw-r--r--
2026-04-08 03:24
upgrade_lts_contract.py
621
B
-rwxr-xr-x
2026-04-08 03:24
Save
Rename
import logging from uaclient import config, defaults, log from uaclient.api.u.pro.status.is_attached.v1 import _is_attached from uaclient.entitlements.entitlement_status import ApplicationStatus from uaclient.entitlements.esm import ESMAppsEntitlement, ESMInfraEntitlement LOG = logging.getLogger("ubuntupro.lib.add_esm_snapshot_auth") ESM_APPS_SNAPSHOT_URLS = [ "snapshot.apps-security.esm.ubuntu.com/apps/ubuntu/", "snapshot.apps-updates.esm.ubuntu.com/apps/ubuntu/", ] ESM_INFRA_SNAPSHOT_URLS = [ "snapshot.infra-security.esm.ubuntu.com/infra/ubuntu/", "snapshot.infra-updates.esm.ubuntu.com/infra/ubuntu/", ] def add_esm_snapshot_auth(cfg): if not _is_attached(cfg).is_attached: LOG.info("Not attached. Not adding ESM snapshot URLs to APT auth.") return for esm, urls in [ (ESMAppsEntitlement(cfg), ESM_APPS_SNAPSHOT_URLS), (ESMInfraEntitlement(cfg), ESM_INFRA_SNAPSHOT_URLS), ]: if ( esm.application_status()[0] != ApplicationStatus.DISABLED and esm.apt_url is not None and "https://esm.ubuntu.com/" in esm.apt_url ): LOG.info( ( "%s is enabled and using default apt url," " adding snapshot auth" ), esm.name, ) esm.update_apt_auth(override_snapshot_urls=urls) else: LOG.info( "%s is disabled or not using default apt url, skipping", esm.name, extra=log.extra(apt_url=esm.apt_url), ) if __name__ == "__main__": try: log.setup_cli_logging( logging.DEBUG, defaults.CONFIG_DEFAULTS["log_level"] ) cfg = config.UAConfig() log.setup_cli_logging(cfg.log_level, cfg.log_file) add_esm_snapshot_auth(cfg) except Exception as e: print(e)