/usr/lib/python3/dist-packages/uaclient/api/u/pro/detach/__pycache__
NameSizeModeActions
v1.cpython-310.pyc37950644editdlrm
__init__.cpython-310.pyc1610644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/api/u/pro/detach/__pycache__/v1.cpython-310.pyc (3795B)
o Ki@s,ddlmZddlmZmZmZmZmZmZm Z ddl m Z ddl m Z ddlmZmZddlmZddlmZddlmZdd lmZmZmZmZmZdd lmZmZm Z dd l!m"Z"Gd d d eeZ#de#fddZ$dede#fddZ%dede#fddZ&e dde%ddZ'ddde#ej(dfgddd Z)dS)!)List)daemon entitlements exceptionslockmessagestimerutil)ProgressWrapper) APIEndpoint)AdditionalInfoErrorWarningObject)_reboot_required) _is_attached)UAConfig) BoolDataValue DataObjectFieldStringDataValue data_list) machine_tokennotices state_files)update_motd_messagesc@sBeZdZedeeddededdgZdee de fddZ dS) DetachResultdisabledz1The services disabled during the detach operation)docreboot_requiredz?True if the system requires a reboot after the detach operationcCs||_||_dSNrr)selfrrr!>/usr/lib/python3/dist-packages/uaclient/api/u/pro/detach/v1.py__init__0s zDetachResult.__init__N) __name__ __module__ __qualname__rrrrfieldsrstrboolr#r!r!r!r"rsrreturncCs ttSr)_detachrr!r!r!r"detach5s r,cfgc Csrtstjztjddt|}WdW|S1swYW|Sty8}zt|d}~ww)zZ This endpoint allows the user to detach the machine from a Pro subscription. zpro.api.u.pro.detach.v1) lock_holderN) r we_are_currently_rootrNonRootUserErrorr RetryLock_detach_in_lock Exceptionclear_lock_file_if_present)r-reter!r!r"r+9s   r+c Cs2t|js tgddSg}g}t|D]S}z tj||d}Wn tjy)Yqw|jdd\}}|rg| t \}}|sb|rL|j rL|j j } |j j } n tjj|d} d} |t| | d|id q||qttjjttt|tt t!|} tt"|| j#d kd} || _$| S) NFr)r-nameT)ignore_dependent_services)titleservice)r9codemetayes)%r is_attachedrrentitlements_disable_orderentitlement_factoryrEntitlementNotFoundError can_disabledisabler messagemsgr7rDISABLE_FAILED_TMPLformatappendr rremoveNoticeLIMITED_TO_RELEASErdelete_state_filesrget_machine_token_filedeleterrstartrstoprsortedrwarnings) r-rrSent_nameentrC_r5reasonrFr<reboot_required_resultresultr!r!r"r2LsX     r2v1DetachN)versionr7fn options_cls32TzD from uaclient.api.u.pro.detach.v1 import detach result = detach() z1Raised if a non-root user executes this endpoint.zpro api u.pro.detach.v1zL { "disabled": ["service1", "service2"], "reboot_required": false } ) introduced_inrequires_networkexample_python result_classr example_cli example_json)*typingruaclientrrrrrrr uaclient.apir uaclient.api.apir uaclient.api.data_typesr r 5uaclient.api.u.pro.security.status.reboot_required.v1r(uaclient.api.u.pro.status.is_attached.v1ruaclient.configruaclient.data_typesrrrrruaclient.filesrrruaclient.timer.update_messagingrrr,r+r2endpointr0_docr!r!r!r"s@ $     9