/usr/lib/python3/dist-packages/uaclient/cli/__pycache__
NameSizeModeActions
api.cpython-310.pyc21050644editdlrm
attach.cpython-310.pyc40180644editdlrm
auto_attach.cpython-310.pyc11240644editdlrm
cli_util.cpython-310.pyc86480644editdlrm
collect_logs.cpython-310.pyc17610644editdlrm
commands.cpython-310.pyc38540644editdlrm
config.cpython-310.pyc66390644editdlrm
cve.cpython-310.pyc46180644editdlrm
cves.cpython-310.pyc31850644editdlrm
detach.cpython-310.pyc29830644editdlrm
disable.cpython-310.pyc63980644editdlrm
enable.cpython-310.pyc109110644editdlrm
fix.cpython-310.pyc205560644editdlrm
formatter.cpython-310.pyc79720644editdlrm
help.cpython-310.pyc13360644editdlrm
parser.cpython-310.pyc32940644editdlrm
refresh.cpython-310.pyc23760644editdlrm
security_status.cpython-310.pyc18530644editdlrm
status.cpython-310.pyc18640644editdlrm
system.cpython-310.pyc12430644editdlrm
__init__.cpython-310.pyc72210644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/cli/__pycache__/disable.cpython-310.pyc (6398B)
o Ki*@sddlZddlZddlZddlmZmZmZddlmZm Z m Z m Z m Z m Z mZmZddlmZddlmZmZddlmZddlmZddlmZmZmZdd lmZdd lm Z e !Z"e#e$e%Z&d ej'd e(d eedee(de(de(f ddZ)ddddZ*ej+ej,e-ej.e/dddZ0ede j1e j2e0ej3eed e j4j5d6e j7e'ddddd ed!e j8j5dd"d#d$ed%e j9j5d&d'dd&d(gd&d)ed*e j:d#d$gd+gd,Z;dS)-N)AnyDictList)configcontract entitlements event_logger exceptionsmessagesstatusutil)ProgressWrapper)ServiceWithDependencies _dependencies)_enabled_services)cli_util) ProArgumentProArgumentGroup ProCommand) HelpCategory)CanDisableFailurecfgserviceall_dependenciesenabled_service_names called_name service_titlec Csg}|D]}|j|ks|j|vrq|jD] }|j|kr!||jqq|D]} t|| } tjj|| d} tj | dsBt j || dq%dS)N)service_being_disableddependent_service)msg) name depends_onappendr get_titler DEPENDENT_SERVICEformatr prompt_for_confirmationr DependentServiceStopsDisable) rrrrrrdependent_servicess requirementrdependent_service_titleuser_msgr-6/usr/lib/python3/dist-packages/uaclient/cli/disable.pyprompt_for_dependency_handlings0    r/T) update_statusc Cs|j}|dur |}|rt}nttj|d}||\}}|sIt|j|durHt|t rH|j durHt |j j tj |j j |j j|jdnt|j|rWtj|d|S)aPerform the disable action on a named entitlement. :param entitlement_name: the name of the entitlement to enable :param cfg: the UAConfig to pass to the entitlement :param json_output: output should be json only @return: True on success, False otherwise N assume_yes) error_msg error_coderr)enabled_variantr rCLIEnableDisableProgressdisableeventservice_failedr isinstancermessageinforerrorservice_processedr ) entitlementr json_outputr2r0variantprogressretreasonr-r-r.perform_disable>s0      rFz pro disablec Ksfg}g}g}g}tjddd}|jdk}|j} t|} |jr(| r(tjdddt |dg} t | |\} } d d t |j D}t|j}d }| D]}t j|||jd }|j}|d ur]|}| szt||j||||jdWn)tjy}zt|| |j| tjj|jdd}WYd }~qId }~ww|rt}nttj| d}||_zT||\}}t j |d|sd}|!||d urt"|t#r|j$d ur| |j$j|!d|j|j$j|j$jdn|!||%}|rd |d<| tj&jddWqItjy7}z+d}|!|| |j| tj'j|jd|!d|j|j|j(|j)dWYd }~qId }~ww| rtd}dd*t j+|dd}d*t,j-|dddd}tj.dd*| |d}| |j|!dd |j|j(|j)dt/0|}|1|r|2|2|rdnd |d!<||d"<||d#<||d$<||d%<t3t4j5|t6j7d d&|rd'Sd(S))zbPerform the disable action on a list of entitlements. @return: 0 on success, 1 otherwise successF)_schema_versionresult needs_rebootjson--purge --assume-yes)option1option2rcSsg|]}|jqSr-)r ).0r)r-r-r. sz"action_disable..T)rr purgeN)rr)titler1r5)typerr< message_coderJzdisable operation) operation)rTrr<rUadditional_infozTry , . P)widthbreak_long_wordsbreak_on_hyphensr8)rVinvalid_service service_msgsystemfailurerIprocessed_servicesfailed_serviceserrorswarnings)cls sort_keysr)8rJSON_SCHEMA_VERSIONr%r2r&create_interactive_only_print_functionrRr InvalidOptionCombinationgetattrrget_valid_entitlement_namesrenabled_servicesrservicesentitlement_factoryr6r/r rSUbuntuProErrorLOG exceptionrr ENABLE_FAILEDr r7calculate_total_disable_steps total_stepsr8r r"r;rr<_check_for_rebootENABLE_REBOOT_REQUIRED_TMPLDISABLE_FAILED_TMPLmsg_coderWjoinvalid_servicestextwrapwrapInvalidServiceOpErrorrUAContractClientupdate_activity_tokensortprintrKdumpsr DatetimeAwareJSONEncoder)argsrkwargsrcrdrerf json_responserAr2interactive_only_printnamesentitlements_foundentitlements_not_foundrrrDent_nameentrBerC disable_retrEent_reboot_required valid_namesr`errcontract_clientr-r-r.action_disablels0                       rr8rXr5)optionsstore+)helpactionnargsrM)command store_true)rrz--formatcli)defaultrK)rrchoicesrrL) arguments)r descriptionr help_categoryargument_groups)s(       . 6