Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
uaclient /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-07-09 11:30
clouds
[ DIR ]
drwxr-xr-x
2022-07-09 11:30
entitlements
[ DIR ]
drwxr-xr-x
2022-07-09 11:30
jobs
[ DIR ]
drwxr-xr-x
2022-07-09 11:30
__init__.py
0
B
-rw-r--r--
2020-10-15 16:52
actions.py
3.48
KB
-rw-r--r--
2022-05-18 21:44
apt.py
18.11
KB
-rw-r--r--
2022-05-18 21:44
cli.py
62.34
KB
-rw-r--r--
2022-05-18 21:44
config.py
31.85
KB
-rw-r--r--
2022-05-18 21:44
contract.py
21.14
KB
-rw-r--r--
2022-05-18 21:44
daemon.py
3.93
KB
-rw-r--r--
2022-05-18 21:44
data_types.py
5.91
KB
-rw-r--r--
2022-05-18 21:44
defaults.py
1.58
KB
-rw-r--r--
2022-05-18 21:44
event_logger.py
7.9
KB
-rw-r--r--
2022-05-18 21:44
exceptions.py
11.41
KB
-rw-r--r--
2022-05-18 21:44
gpg.py
813
B
-rw-r--r--
2021-04-29 18:29
lock.py
3.51
KB
-rw-r--r--
2022-04-01 15:27
messages.py
24.9
KB
-rw-r--r--
2022-05-18 21:44
pip.py
756
B
-rw-r--r--
2022-04-01 15:27
security.py
43
KB
-rw-r--r--
2022-05-18 21:44
security_status.py
6.69
KB
-rw-r--r--
2022-05-18 21:44
serviceclient.py
5.8
KB
-rw-r--r--
2022-05-18 21:44
snap.py
2.92
KB
-rw-r--r--
2022-04-01 15:27
status.py
22.92
KB
-rw-r--r--
2022-05-18 21:44
types.py
308
B
-rw-r--r--
2022-04-01 15:27
util.py
32.71
KB
-rw-r--r--
2022-05-18 21:44
version.py
1.94
KB
-rw-r--r--
2022-06-20 16:29
Save
Rename
import logging import sys from typing import Optional # noqa: F401 from uaclient import ( clouds, config, contract, entitlements, event_logger, exceptions, messages, ) from uaclient import status as ua_status from uaclient.clouds import identity LOG = logging.getLogger("ua.actions") event = event_logger.get_event_logger() def attach_with_token( cfg: config.UAConfig, token: str, allow_enable: bool ) -> None: """ Common functionality to take a token and attach via contract backend :raise UrlError: On unexpected connectivity issues to contract server or inability to access identity doc from metadata service. :raise ContractAPIError: On unexpected errors when talking to the contract server. """ from uaclient.jobs.update_messaging import update_apt_and_motd_messages try: contract.request_updated_contract( cfg, token, allow_enable=allow_enable ) except exceptions.UrlError as exc: # Persist updated status in the event of partial attach ua_status.status(cfg=cfg) update_apt_and_motd_messages(cfg) raise exc except exceptions.UserFacingError as exc: event.info(exc.msg, file_type=sys.stderr) # Persist updated status in the event of partial attach ua_status.status(cfg=cfg) update_apt_and_motd_messages(cfg) raise exc current_iid = identity.get_instance_id() if current_iid: cfg.write_cache("instance-id", current_iid) update_apt_and_motd_messages(cfg) def auto_attach( cfg: config.UAConfig, cloud: clouds.AutoAttachCloudInstance ) -> None: """ :raise UrlError: On unexpected connectivity issues to contract server or inability to access identity doc from metadata service. :raise ContractAPIError: On unexpected errors when talking to the contract server. :raise NonAutoAttachImageError: If this cloud type does not have auto-attach support. """ contract_client = contract.UAContractClient(cfg) try: tokenResponse = contract_client.request_auto_attach_contract_token( instance=cloud ) except exceptions.ContractAPIError as e: if e.code and 400 <= e.code < 500: raise exceptions.NonAutoAttachImageError( messages.UNSUPPORTED_AUTO_ATTACH ) raise e token = tokenResponse["contractToken"] attach_with_token(cfg, token=token, allow_enable=True) def enable_entitlement_by_name( cfg: config.UAConfig, name: str, *, assume_yes: bool = False, allow_beta: bool = False ): """ Constructs an entitlement based on the name provided. Passes kwargs onto the entitlement constructor. :raise EntitlementNotFoundError: If no entitlement with the given name is found, then raises this error. """ ent_cls = entitlements.entitlement_factory(cfg=cfg, name=name) entitlement = ent_cls( cfg, assume_yes=assume_yes, allow_beta=allow_beta, called_name=name ) return entitlement.enable() def status( cfg: config.UAConfig, *, simulate_with_token: Optional[str] = None, show_beta: bool = False ): """ Construct the current UA status dictionary. """ if simulate_with_token: status, ret = ua_status.simulate_status( cfg=cfg, token=simulate_with_token, show_beta=show_beta ) else: status = ua_status.status(cfg=cfg, show_beta=show_beta) ret = 0 return status, ret