| Server IP : 217.113.158.245 / Your IP : 216.73.217.83 Web Server : Apache/2.4.41 (Ubuntu) System : Linux bg-hoster 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.27 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/2777501/root/lib/ubuntu-advantage/ |
Upload File : |
"""
Try to auto-attach in a GCP instance. This should only work
if the instance has a new UA license attached to it
"""
import logging
from uaclient.cli import setup_logging
from uaclient.config import UAConfig
from uaclient.jobs.license_check import gcp_auto_attach
LOG = logging.getLogger("ua_lib.license_check")
if __name__ == "__main__":
cfg = UAConfig()
# The ua-license-check logger should log everything to its file
setup_logging(
logging.CRITICAL,
logging.DEBUG,
log_file=cfg.license_check_log_file,
logger=LOG,
)
# Make sure the ua-license-check logger does not generate double logging
LOG.propagate = False
# The root logger should log any error to the timer log file
setup_logging(
logging.CRITICAL, logging.ERROR, log_file=cfg.license_check_log_file
)
gcp_auto_attach(cfg=cfg)