/usr/lib/python3/dist-packages/uaclient/api/u/pro/services/disable/__pycache__
NameSizeModeActions
v1.cpython-310.pyc46350644editdlrm
__init__.cpython-310.pyc1710644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/api/u/pro/services/disable/__pycache__/v1.cpython-310.pyc (4635B)
o Ki @szddlZddlmZmZddlmZmZmZmZm Z ddl m Z m Z m Z ddlmZddlmZddlmZddlmZdd lmZdd lmZmZmZmZmZee e Z!Gd d d eZ"Gd ddeeZ#dedee$fddZ% d'de"dee de#fddZ& d'de"dedee de#fddZ'edde'e"ddZ(ddde#e j)dfe j*d fe j+d!fe j,d"fe j-d#fgd$d%d&Z.dS)(N)ListOptional) entitlementslockmessagesstatusutil)AbstractProgressProgressWrapper exceptions) APIEndpoint)AdditionalInfo)_enabled_services) _is_attached)UAConfig) BoolDataValue DataObjectFieldStringDataValue data_listc@sBeZdZededdededddgZdddedefdd Z d S) DisableOptionsservicezPro service to disabledocpurgeFzqAlso remove all packages that were installed from this service. Only supported by some services. (default: false))rcCs||_||_dSN)rr)selfrrrH/usr/lib/python3/dist-packages/uaclient/api/u/pro/services/disable/v1.py__init__$s zDisableOptions.__init__N) __name__ __module__ __qualname__rrrfieldsstrboolrrrrrrs  rc@s2eZdZedeeddgZdeefddZ dS) DisableResultdisabledzList of services disabledrcCs ||_dSrr')rr'rrrr2s zDisableResult.__init__N) r r!r"rrrr#rr$rrrrrr&)sr&cfgreturncCsddt|jDS)NcSsg|]}|jqSr)name).0srrr 7sz+_enabled_services_names..)renabled_servicesr)rrr_enabled_services_names6sr1optionsprogress_objectcCst|t|dS)N)r3)_disabler)r2r3rrrdisable:sr5c CsRt|}ts tt|jsttj ||j |j d}t |}|j |vr-t gdS|j}|dur6|}||_d}d}ztjdd||\}}Wdn1sXwYWntyp} zt| d} ~ ww|s|dur|jdur|j} ntj} tj|j | dt |} tj|d|t ttt|t| dS) zt Disable a Pro service. This will automatically disable any services that depend on the target service. )r)r+rr(NFzu.pro.services.disable.v1) lock_holder)rreasonr0) r rwe_are_currently_rootr NonRootUserErrorr is_attachedUnattachedErrorrentitlement_factoryrrr1r&enabled_variantcalculate_total_disable_steps total_stepsr RetryLockr5 Exceptionclear_lock_file_if_presentmessagerGENERIC_UNKNOWN_ISSUEEntitlementNotDisabledErrorrfinishsortedlistset difference) r2r)r3progress entitlementenabled_services_beforevariantsuccess fail_reasoner7enabled_services_afterrrrr4@sh     r4v1DisableServiceT)versionr+fn options_clssupports_progress32z| from uaclient.api.u.pro.services.disable.v1 import disable, DisableOptions result = disable(DisableOptions(service="usg")) zWhen called as non-root userzCWhen called on a machine that is not attached to a Pro subscriptionz9When the service argument is not a valid Pro service namez8When another Ubuntu Pro related operation is in progressz!When the service fails to disablez4pro api u.pro.services.disable.v1 --args service=usgz+ { "disabled": [ "usg" ] } ) introduced_inrequires_networkexample_python result_classr example_cli example_jsonr)/loggingtypingrruaclientrrrrr uaclient.apir r r uaclient.api.apir uaclient.api.data_typesr -uaclient.api.u.pro.status.enabled_services.v1r(uaclient.api.u.pro.status.is_attached.v1ruaclient.configruaclient.data_typesrrrrr getLoggerreplace_top_level_logger_namer LOGrr&r$r1r5r4endpointr9r;EntitlementNotFoundError LockHeldErrorrE_docrrrrsx         L