404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.22.27.41: ~ $
3

e�$g��@s�ddlZddlZddlZddlZddlZddlmZmZddlmZddlm	Z	ddlm
Z
ddlmZddlmZddlm
Z
dd	lmZdd
lmZddlmZddlmZmZdd
lmZy4ddlZddlZddlmZmZmZmZmZm Z WnFe!k
�r:ddl"j#Zddl$j%Ze&Ze'Ze(Ze)Ze*Ze*Z e+Z,YnXyddl-m.Z.Wne!k
�rfdZ.YnXddl/Z/e/j0ddd�Z1e2e1d��s�e1j/e1_3e1j3Z4dZ5de5Z6de5Z7dZ8dZ9dZ:dZ;dZ<ddddd �Z=d!d"�e=j>�D�Z?dd#lm@Z@e@jA�ZBejC�ZDd$d%�ZEd&d'�ZFd(d)�ZGd*d+�ZHd,d-�ZId.d/�ZJd0d1�ZKd2d3�ZLd4d5�ZMe)eNd6�d7d8�ZOeNd9�d:d;�ZPd�d=d>�ZQd?d@�ZRdAdB�ZSdCdD�ZTdEdF�ZUdGdH�ZVdIdJ�ZWdKdL�ZXdMdN�ZYdOdP�ZZGdQdR�dR�Z[d�eNdS�dTdU�Z\dVdW�Z]dXdY�Z^dZd[�Z_d\d]�Z`e)d^�d_d`�Zad�dadb�Zbdcdd�Zcdedf�Zddgdh�Zedddddifdidj�Zfdkdl�Zgdmdn�Zhdodp�Zidqdr�Zjdsdt�Zkdudv�Zld�dwdx�ZmGdydz�dz�Znd{d|�Zod}d~�Zpd�dd��Zqd�d��Zre�d�k�r�d�d��Zsndd�ltmsZsdS)��N)�up2dateUtils�cldetect)�
up2dateErrors)�up2dateAuth)�	rhnserver)�pkgUtils)�
up2dateLog)�rhnreg_constants)�hardware)�convertPackagesFromHashToList)�getPlatform)�ustr�sstr)�
raise_with_tb)�ListType�	TupleType�
StringType�UnicodeType�DictType�DictionaryType)�supportzrhn-client-toolsT)Zfallback�ugettextz/etc/sysconfig/rhnz%s/rhn_register_remindz%s/hw-activation-codez/etc/pki/consumer/cert.pemz$/etc/sysconfig/rhn/cl-rollout-ca.pemz!/etc/sysconfig/rhn/cl-rollout.pemz%/etc/sysconfig/rhn/cl-rollout-key.pemz/etc/sysconfig/rhn/jwt.tokenZ
shared_pro�shared�solo�admin)zCloudLinux OS Shared ProzCloudLinux OS SharedzCloudLinux OS SolozCloudLinux OS AdmincCsi|]\}}||�qS�r)�.0�k�vrr�/usr/lib/python3.6/rhnreg.py�
<dictcomp>Ksr )�configcCs&tjdtjtjB��r"d}d}tj|tjtjB�sNtjdtjtjB�rNd}d}tjd|tj�r�tj|tjtjB�r�tjd|�tjd|�nttd	��n�tjd
tjtjB�r�tjd�nttd��d
}tj|tjtjB��stjdtjtjB��rd}tjd|�}|�r"tjd|�dS)Nz/usr/sbin/rhnsdz/usr/lib/systemd/systemz/usr/bin/systemctlz/bin/systemctlz/lib/systemd/systemz%s/rhnsd.servicez%s enable rhnsd > /dev/nullz%s start rhnsd > /dev/nullz,Warning: unable to enable rhnsd with systemdz/sbin/chkconfigz$/sbin/chkconfig rhnsd on > /dev/nullz.Warning: unable to enable rhnsd with chkconfigz
/sbin/servicez/usr/sbin/servicez%s rhnsd status > /dev/nullz%s rhnsd start > /dev/null)�os�access�R_OK�X_OK�system�print�_)Zsystemd_system_unitdirZsystemd_systemctlZservice_pathZrcrrr�
startRhnsdSs,r)cCs�tdp
d}tj|tj�siSt|d�}|j�}i}x`|D]X}|j�}|dkrPq:y|jd�\}}Wn"tk
r�t	t
j|��YnX|j�||<q:W|S)NZoemInfoFilez/etc/sysconfig/rhn/oeminfo�r��:)�cfgr"r#r$�open�	readlines�strip�split�
ValueErrorrrZOemInfoFileError)Z
configFile�fd�L�info�i�key�valuerrr�
getOemInfots 

r9cCs*tjttj�r"tjt�}|jdkSdSdS)z@ Returns true if system is registred using subscription manager rFN)r"r#�	RHSM_FILEr$�stat�st_size)Zstatinforrr�rhsm_registered�s

r=cCstjtdtj�S)N�systemIdPath)r"r#r-r$rrrr�
registered�sr?cCs$tjttj�s ttd�}|j�dS)Nzw+)r"r#�REMIND_FILEr$r.�close)r3rrr�createSystemRegisterRemindFile�s
rBcCstjttj�rtjt�dS)N)r"r#r@r$�unlinkrrrr�removeSystemRegisterRemindFile�srDcCs�tjj|�}tj|tj�sdStj|tj�rLytj||d�Wn
dStj|tjtj	Bt
dd��}tj|d�}z|jt
|��Wd|j�XdS)z; Write a file to disk that is not readable by other users. Fz.saveZ0600��wNT)r"�path�dirnamer#�W_OK�F_OK�renamer.�O_WRONLY�O_CREAT�int�fdopen�writerrA)Zsecure_fileZ
file_contentsZdir_namer3Zfd_filerrr�_write_secure_file�s
rQcCs"ttd|�}|rt�t�|S)Nr>)rQr-rD�updateRhsmStatus)�systemId�resrrr�
writeSystemId�s
rUcCsxd}tj�}|dkrdSy6tj|�}|j�}|j|�dj}t|dd��}Wn$ttj	fk
rrt
jd�dSX|S)Nz'//member[name='system_id']/value/stringr�z@systemID file doesn't have system_id field or the file is broken)r�getSystemId�libxml2ZparseDocZxpathNewContextZ	xpathEvalZcontentrN�
IndexErrorZparserError�log�log_me)Z	xpath_strrS�result�context�	system_idrrr�extract_system_id�s

r_)�token�allowTransitioncCsnddl}ddl}|jjd�s dSdd|g}|r8|jd�|j|�}|j�\}}|jdkrjtj	d||f�dS)zH
    Execute binary file which we use as hook for jwt token updates
    rNz /opt/cloudlinux/venv/bin/python3z/usr/sbin/cl-pre-jwt-updatez--new-tokenz--allow-transitionz7Pre jwt update hook failed with stdout=%s and stderr=%s)
�
subprocessr"rG�exists�append�Popen�communicate�
returncoderZr[)r`rarbr"�cmd�p�stdout�stderrrrr�_execute_pre_jwt_update_hook�s



rl)racCsjddl}ddl}|jjd�s dSdg}|r4|jd�|j|�}|j�\}}|jdkrftj	d||f�dS)zH
    Execute binary file which we use as hook for jwt token updates
    rNz /opt/cloudlinux/venv/bin/python3z/usr/sbin/cl-post-jwt-updatez--allow-transitionz8Post jwt update hook failed with stdout=%s and stderr=%s)
rbr"rGrcrdrerfrgrZr[)rarbr"rhrirjrkrrr�_execute_post_jwt_update_hook�s


rmFcCs�tj�}y|jj|�}WnFtjk
r.dStjtjtjtj	fk
r^t
jtj
��dSXt||�tt|�t|�dS)z�
    Get a JWT token from CLN and save it to the file
    :param systemId: content of file `/etc/sysconfig/rhn/systemid`
    :return: None
    N)r�	RhnServer�up2dateZgetJWTTokenr�UnknownMethodException�AuthenticationTicketError�RhnUuidUniquenessError�CommunicationError�$AuthenticationOrAccountCreationErrorrZ�
log_exception�sys�exc_inforlrQ�	JWT_TOKENrm)rSraZ
xmlrpm_serverr\rrr�getAndWriteJWTTokenToFile�s

ryc;Cs�d	}|dkr�ytjt�Wnttfk
r2YnXytjt�Wnttfk
rZYnXytjt�Wnttfk
r�YnXdStj�}y|j	j
|�}WnFtjk
r�dStj
tjtjtjfk
r�tjtj��dSXx,|D]$}||j�kr�tjdj|��dSq�Wytj|d�}Wn tk
�rHtjd�dSXytj|d�}Wn tk
�r|tjd�dSXytj|d�}Wn tk
�r�tjd�dSXtt|�tt|�tt|�dS)
z�
    Get ca.crt, rollout.crt and rollout.key from CLN
    and write them to files
    :param systemId: registration ID
    :return: None
    �cert_base64�	ca_base64�
key_base64NzCLN did not return "{}".z/CLN returned incorrectly encoded CA certificatez,CLN returned incorrectly encoded rollout keyz4CLN returned incorrectly encoded rollout certificate)rzr{r|)r"�remove�ROLLOUT_KEY�OSError�IOError�ROLLOUT_CERT�ROLLOUT_CA_CERTrrnroZgetCLNCertificaterrprqrrrsrtrZrurvrw�keysr[�format�base64Z	b64decode�	TypeErrorrQ)rSr��sr\r7Zca_certZrollout_keyZrollout_certrrr�"prepareGradualRolloutCertsIfNeededsh


r�cCstt|d�S)z=Returns True if the write is successful or False if it fails.�
)rQ�HW_CODE_FILE)�hw_activation_coderrr�writeHWCode\sr�cCspy"tjjd�r t�\}}||fSWntk
r6YnXt�\}}|dk	rR||fSt�\}}|dk	rl||fSdS)a�
    This function returns the UUID and virtualization type of this system, if
    it is a guest.  Otherwise, it returns None.  To figure this out, we'll
    use a number of heuristics (list in order of precedence):

       1.  Check /proc/xen/xsd_port.  If exists, we know the system is a
           host; exit.
       2.  Check SMBIOS.  If vendor='Xen' and UUID is non-zero, we know the
           system is a fully-virt guest; exit.
       3.  Check /sys/hypervisor/uuid.  If exists and is non-zero, we know
           the system is a para-virt guest; exit.
       4.  If non of the above checks worked; we know we have a
           non-xen-enabled system; exit.
    z/proc/xen/xsd_portN)NN)r"rGrc�get_fully_virt_infor��get_para_virt_info)�uuid�	virt_typerrr�
get_virt_info`s


r�cCsVy<tdd�}|j�}|j�|j�jdd�jd�}d}||fStk
rPYnXdS)	z�
    This function checks /sys/hypervisor/uuid to see if the system is a
    para-virt guest.  It returns a (uuid, virt_type) tuple.
    z/sys/hypervisor/uuidr*�-r+z
ZparaN)NN)r.�readrA�lower�replace�rstripr�)Z	uuid_filer�r�rrrr��s
r�cCs@tj�}tj�}|j�dkr8|j�jdd�}d}||fSdSdS)z�
    This function looks in the SMBIOS area to determine if this is a
    fully-virt guest.  It returns a (uuid, virt_type) tuple.
    Zxenr�r+ZfullyN)NN)r
Z
dmi_vendorZdmi_system_uuidr�r�)Zvendorr�r�rrrr��sr�cCstd|�}t|�td�kS)Nz0x%sr)�eval�long)r�rrr�
_is_host_uuid�sr�cCstj�}|jj�S)N)rrn�registrationZwelcome_message)r�rrr�welcomeText�sr�cCstj�}|jj�dS)N)rrn�capabilitiesZvalidate)r�rrr�getCaps�sr�cCstj�}|jj||�S)N)rrnr�Zreserve_user)�username�passwordr�rrr�reserveUser�sr�c@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�RegistrationResultNcCsB||_||_||_||_||_t|�dkr2||_nd|_||_dS)Nr)�	_systemId�	_channels�_failedChannels�_systemSlots�_failedSystemSlots�len�_universalActivationKey�rawDict)�selfrS�channelsZfailedChannels�systemSlotsZfailedSystemSlotsZuniversalActivationKeyr�rrr�__init__�szRegistrationResult.__init__cCs|jS)N)r�)r�rrrrW�szRegistrationResult.getSystemIdcCs|jS)N)r�)r�rrr�getChannels�szRegistrationResult.getChannelscCs|jS)N)r�)r�rrr�getFailedChannels�sz$RegistrationResult.getFailedChannelscCs|jS)N)r�)r�rrr�getSystemSlots�sz!RegistrationResult.getSystemSlotscs�fdd��jD�S)Ncsg|]}�j|��qSr)�_getSlotDescription)rr�)r�rr�
<listcomp>�sz@RegistrationResult.getSystemSlotDescriptions.<locals>.<listcomp>)r�)r�r)r�r�getSystemSlotDescriptions�sz,RegistrationResult.getSystemSlotDescriptionscs�fdd��jD�S)Ncsg|]}�j|��qSr)�_getFailedSlotDescription)rr�)r�rrr��szFRegistrationResult.getFailedSystemSlotDescriptions.<locals>.<listcomp>)r�)r�r)r�r�getFailedSystemSlotDescriptions�sz2RegistrationResult.getFailedSystemSlotDescriptionscCs|jS)z5Returns None if no universal activation key was used.)r�)r�rrr�getUniversalActivationKey�sz,RegistrationResult.getUniversalActivationKeycCst|j�dkot|j�dkS)z�Returns True if the system was subscribed to at least one channel
        and was given any type of system slot so it will get updates. In other
        words, returns True if the system will be getting at least basic
        updates.

        r)r�r�r�)r�rrr�hasBaseAndUpdates�s	z$RegistrationResult.hasBaseAndUpdatescCs&|dkrtjdtjS|j|�SdS)N�virtualization_host� )r	�VIRTZVIRT_FAILEDr�)r��slotrrrr��sz,RegistrationResult._getFailedSlotDescriptioncCs$|dkrtjS|dkrtjS|SdS)NZenterprise_entitledr�)r	Z
MANAGEMENTr�)r�r�rrrr��s
z&RegistrationResult._getSlotDescription)N)�__name__�
__module__�__qualname__r�rWr�r�r�r�r�r�r�r�r�rrrrr��s

r�)�human_readablec	CsFd}tjj|�sdSt|�� }|j�jd�}|r4|St|SQRXdS)Nz/opt/cloudlinux/cl_editionrr�)r"rGrcr.r�r0�_human_readable_to_product)r�Zedition_cache_file�fZraw_editionrrr�getServerEdition�s
r�cCslddlm}m}tjjd�s"t��d}||d||d�}dd�|j�D�\}}|rVt��t|d	d�j	d
��S)Nr)re�PIPEz/opt/cloudlinux/venv/binzZ/opt/cloudlinux/venv/bin/python3 -c "from clcommon.cpapi import cpusers; print(cpusers())"T)�shellrjrkcSsg|]}|j�j��qSr)�decoder0)rr\rrrr�sz.get_users_count_from_cllib.<locals>.<listcomp>�z, ���)
rbrer�r"rGrcr2rfr�r1)rer�rhZprocess�output�errorsrrr�get_users_count_from_cllibsr�cCsddlm}|�}t|j��S)Nr)�ClPwd)Zup2date_client.clpwdr�r�Zget_uid_dict)r��pwdrrr�get_users_count_genericsr�cCs*y
t�}Wntk
r$t�}YnX|S)N)r��	Exceptionr�)Zusers_countrrr�countServerUsers s

r�cCsTyt|�}WnPtjk
rH}ztd|j�tjd�WYdd}~Xntjk
r\dSXt�}|d}||krxdS|r�tdj	t
|t
|d��td�tjd�|�sPtjj�s�td�td�t
|�dt
|�d	�}d
dd�}|j
|�}	|	dk	�rHt�}
|
|	k�r4td||�d
|
�d��tjd�n|�d||�d�}t|�dS)Nz%sr��editionz�WARNING: Automatic registration in yum transactions is only available when edition matches the provided license. Your current edition is {current_edition} and your license is {new_edition}.)Zcurrent_editionZnew_editionz0Run clnreg_ks manually to complete registration.aError: interactive input required for edition migration, but tool is running in non-interactive mode. Please try running the tool again in interactive shell or add `--migrate-silently` flag to accept allquestions and perform the edition migration silently.za edition installed on your server does not match license you are trying to register server with: zh. Migration is required. You may lose access to the services which are not supported by the new edition.�)rrz@The license you are trying to register with allows a maximum of z% hosting accounts which is less than z) users detected on this server. Aborting.zG Also, the license you are trying to register with allows a maximum of zM hosting accounts. Make sure that your system complies with this requirement.)�checkKeyrrsr'�errmsgrv�exitrpr�r��_product_to_human_readable�stdin�isatty�getr��_askConfirmation)�
activationKeyZ
strictEditionZsilentMigrationZlicenseInformation�eZcurrentEditionZlicenseEdition�messageZedition_to_users_limitZlicense_users_limitZusers_on_serverrrr�checkLicenseKey(sB




r�)�confirmationMessagecCs2t|�td�}|j�dkr.td�tjd�dS)zS
    Prints message and makes sure that client is ready for edition migration.
    z Do you want to continue? [N/y]: �yzAborted.r�N)r'�inputr�rvr�)r�Zresponserrrr�fs
r�cCs�|dkr|dkstd��|tj�tj�tj�d�}tj�}|dk	rJ||d<|rlx|j�D]\}}	|	||<qXW|rz||d<n||d<||d<|dk	r�||d<n(tj	j
d	�r�d
ntj	j
d�r�dnd
|d<tdr�tt
j��|d<tj�}
|
jj|�}|S)ziWrapper for the old xmlrpc to register a system. Activates subscriptions
    if a reg num is given.

    Nz)username and password usage is deprecated)Zprofile_nameZ
os_releaseZrelease_nameZarchitecturer^r`r�r�r�z/etc/cloudlinux-edition-solorz/etc/cloudlinux-edition-adminrr�supportsSMBIOS�smbios)�AssertionErrorr�
getVersion�getOSRelease�getArchrrW�itemsr"rGrcr-�_encode_charactersr
�
get_smbiosrrnr�Z
new_system)r�r��profileNamer`�otherr�Z	auth_dictZ
system_id_xmlr7�itemr��retrrr�registerSystemrs2

r�cCstj�}|jj|�}|S)zG
    Check the activation key and return it's edition and customer
    )rrnr�Z
license_check)r�r�r�rrrr��sr�cCsly,tj�}|j|dddd�}tj|dd�}Wntjk
rBdSXy|j�Wntjk
rfYnXdS)Nzcom.redhat.SubscriptionManagerz/EntitlementStatusF)Z
introspectz0com.redhat.SubscriptionManager.EntitlementStatus)Zdbus_interface)�dbusZ	SystemBusZProxyObjectClassZ	InterfaceZ
DBusExceptionZcheck_status)ZbusZvalidity_objZvalidity_ifacerrrrR�s
rRcCs�tj�}tj�}tj�}tj�}d}y|jj|||||�}Wn@tj	k
r|t
j�d}|jdkrvt
tj|j��n�YnX|S)Nr��c)rrnrr�r�Z
getReleaser�Zavailable_eus_channels�	xmlrpclibZFaultrvrwZ	faultCoderrZ
DelayErrorZfaultString)r�r�r�Zserver_archZserver_versionZserver_releaseZavailableChannelsr�rrr�getAvailableChannels�s 

r�c
	Cs$|dkri}|r6|dkst�|dks(t�|dk	sZt�n$|dk	sBt�|dk	sNt�|dksZt�x|j�D]}|dksdt�qdWtdr�ttj��|d<tj�}|r�|jj	|t
j�t
j�t
j
�||�}n$|jj|t
j�t
j�t
j
�|||�}tjd	|�t|d
|d|d|d
|d|d|d�}	|	S)a�Uses the new xmlrpcs to register a system. Returns a dict instead of just
    system id.

    The main differences between this and registerSystem and that this doesn't
    do activation and does child channel subscriptions if possible. See the
    documentation for the xmlrpc handlers in backend for more detail.

    If nothing is going to be in other, it can be {} or None.

    New in RHEL 5.

    N�registration_number�org_id�	virt_uuidr��channelr�r�zReturned:
%sr^r�Zfailed_channelsZsystem_slotsZfailed_system_slotsZuniversal_activation_key)r�)r�r�r�r�r�)r�r�r-r�r
r�rrnr�Znew_system_activation_keyrr�r�r�Znew_system_user_passrZ�	log_debugr�)
r�r�r�Zpackagesr�r�r7r�r5r\rrr�registerSystem2�sNr�cCstdS)NZsupportsEUS)r-rrrr�server_supports_eussr�csFdd��tj�}|jjdd�s0�fdd�|D�}|jj|t|��dS)NcSs|ddkrd|kr|d=|S)N�classZNETINFOZip6addrr)�xrrr�remove_ip6addrsz$sendHardware.<locals>.remove_ip6addrZipv6r�csg|]}�|��qSrr)rr6)r�rrr�!sz sendHardware.<locals>.<listcomp>)rrnr��
hasCapabilityr�Zadd_hw_profiler�)rSZhardwareListr�r)r�r�sendHardwares
r�cCs0tj�}|jjdd�st|�}|jj||�dS)Nz xmlrpc.packages.extended_profile�)rrnr�r�rr�Zadd_packages)rSZpackageListr�rrr�sendPackages$srcCstdk	rtj�dS)N)rZrefresh)rSrrr�sendVirtInfo+srcCstj�}t|jj|��dS)N)rrnr'r�Z
list_packages)rSr�rrr�listPackages/srcCs�tj|�\}}}}}}|dks&|dkrDd|}tj|�\}}}}}}|d	krVtjd��|dksn|dksn|dkrrd}tj||||||f�}|S)
zzRaises up2dateErrors.InvalidProtocolError if the server url has a
    protocol specified and it's not http or https.

    Nr+zhttps://�https�httpzCYou specified an invalid protocol. Only https and http are allowed.�/z/XMLRPC)rr)�urlparserZInvalidProtocolErrorZ
urlunparse)�serverZprotocol�hostrGZ
parametersZqueryZfragmentIdentifierrrr�makeNiceServerUrl3s
r	cCsdS)zdReturns 'hosted' if the url points to a known hosted server. Otherwise
    returns 'satellite'.
    Z	satelliter)Z	serverUrlrrr�
getServerTypeIsr
c@sBeZdZdZdZiifdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)�ActivationResultrr�cCs||_||_||_||_dS)zschannels and systemSlots are dicts where the key/value pairs are
        label (string) / quantity (int).

        N)�_status�_regNumr�r�)r�ZstatusZregistrationNumberr�r�rrrr�TszActivationResult.__init__cCs|jS)N)r)r�rrr�	getStatus_szActivationResult.getStatuscCs|jS)N)r
)r�rrr�getRegistrationNumberbsz&ActivationResult.getRegistrationNumbercCs|jS)z7Returns a dict- the key/value pairs are label/quantity.)r�)r�rrr�getChannelsActivatedesz%ActivationResult.getChannelsActivatedcCs|jS)z7Returns a dict- the key/value pairs are label/quantity.)r�)r�rrr�getSystemSlotsActivatedisz(ActivationResult.getSystemSlotsActivatedN)
r�r�r��
ACTIVATED_NOW�ALREADY_USEDr�rrrrrrrrrPsrcGs�g}x�|D]�}t|�}|tkr(t|�}nZ|tkrDtdd�|D��}n>|tkr\dd�|D�}n&|tksl|tkr�tdd�|j	�D��}|j
|�q
Wt|�dkr�|dSt|�SdS)	u� All the data we gathered from dmi, bios, gudev are in utf-8,
            we need to convert characters beyond ord(127) - e.g ® to unicode.
        css|]}t|�VqdS)N)r�)rr6rrr�	<genexpr>wsz%_encode_characters.<locals>.<genexpr>cSsg|]}t|��qSr)r�)rr6rrrr�ysz&_encode_characters.<locals>.<listcomp>cSsg|]\}}t||��qSr)r�)r�name�valrrrr�{sr�rN)�typerr
r�tuplerrr�dictr�rdr�)�argsr\r�Z	item_typerrrr�ms

r�cCs�d}d}d}ytj�}t|�}Wn$tjd�tjtj��YnX|dk	r�y.t|||�}|j	�t
jkrz|j�}t
|�Wn>tjk
r�tjd�Yn tjk
r�tjd�YnX|S)NzMThere was an error while reading the hardware info from the bios. Traceback:
z<There are are no entitlements associated with this hardware.z,The hardware id was not recognized as valid.)r
Zget_hal_system_and_smbiosr�rZr[rurvrw�activateHardwareInforrrrr�rZNotEntitlingErrorr�ZInvalidRegistrationNumberError)Zloginr�ZactivateHWResult�hardwareInfor�rrr�_activate_hardware�s*

rc
Cs�i}|rd|i}tj�}|jj||||�}|d}|d}tjd|�|dkr\ttj|�S|dkrpttj|�Sd|}	t	j
|	��dS)	z�Tries to activate an entitlement linked to the hardware info that we
    read from the bios.

    Returns an ActivationResult.
    Can raise:
        Invalid number.
        Hardware info is not entitling.
        Communication errors, etc

    r�Zstatus_coder�zServer returned status code %srr�zNThe server returned unknown status code %s while activating the hardware info.N)rrnr�Zactivate_hardware_inforZr�rrrrrs)
r�r�rZorgIdr�rr\Z
statusCodeZregNumr�rrrr�s 
rcCsdtjdtjtjB�rVddlm}m}|dg|||d�}tdd�|jj	�|j
j	��n
tjd�dS)Nz/usr/sbin/rhn_checkr)rer�)r�rjrkcSs
tj|�S)N)rZr[)r�rrr�<lambda>�sz$spawnRhnCheckForUI.<locals>.<lambda>z Warning: unable to run rhn_check)
r"r#r$r%rbrer��maprjr/rkrZr[)rer�rirrr�spawnRhnCheckForUI�s
r ZdebcCsdS)z.On Debian no extra action for plugin is neededr�r)r�rrrrrr�pluginEnable�sr!)r!)F)F)NNNNNN)N)N)ur"rvr�r�rXZup2date_clientrrrrrrrr	r
Zup2date_client.rhnPackageInforZup2date_client.pkgplatformrZrhn.i18nr
rZrhn.tbrrr��typesrrrrrr�ImportErrorZurllib.parse�parseZ
xmlrpc.clientZclient�listr�bytes�strrrNr�Zvirtualizationr�gettextZtranslation�t�hasattrrr(Z	SYSID_DIRr@r�r:r�r�r~rxr�r�r�r!ZinitUp2dateConfigr-ZinitLogrZr)r9r=r?rBrDrQrUr_�boolrlrmryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rRr�r�r�r�rrrr	r
rr�rrr r!Zup2date_client.pmPluginrrrr�<module>	s�$



!

E,?>
-;


"



Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
capabilities.cpython-36.opt-1.pyc File 5.28 KB 0644
capabilities.cpython-36.pyc File 5.34 KB 0644
cldetect.cpython-36.opt-1.pyc File 2.31 KB 0644
cldetect.cpython-36.pyc File 2.31 KB 0644
clientCaps.cpython-36.opt-1.pyc File 1.98 KB 0644
clientCaps.cpython-36.pyc File 1.98 KB 0644
clpwd.cpython-36.opt-1.pyc File 3.9 KB 0644
clpwd.cpython-36.pyc File 3.9 KB 0644
config.cpython-36.opt-1.pyc File 10.38 KB 0644
config.cpython-36.pyc File 10.38 KB 0644
debUtils.cpython-36.opt-1.pyc File 2.03 KB 0644
debUtils.cpython-36.pyc File 2.03 KB 0644
getMethod.cpython-36.opt-1.pyc File 2.25 KB 0644
getMethod.cpython-36.pyc File 2.25 KB 0644
haltree.cpython-36.opt-1.pyc File 3.07 KB 0644
haltree.cpython-36.pyc File 3.07 KB 0644
hardware.cpython-36.opt-1.pyc File 18.42 KB 0644
hardware.cpython-36.pyc File 18.42 KB 0644
hardware_gudev.cpython-36.opt-1.pyc File 7.69 KB 0644
hardware_gudev.cpython-36.pyc File 7.69 KB 0644
hardware_hal.cpython-36.opt-1.pyc File 6.73 KB 0644
hardware_hal.cpython-36.pyc File 6.73 KB 0644
hardware_udev.cpython-36.opt-1.pyc File 7.67 KB 0644
hardware_udev.cpython-36.pyc File 7.67 KB 0644
pkgUtils.cpython-36.opt-1.pyc File 269 B 0644
pkgUtils.cpython-36.pyc File 269 B 0644
pkgplatform.cpython-36.opt-1.pyc File 288 B 0644
pkgplatform.cpython-36.pyc File 288 B 0644
pmPlugin.cpython-36.opt-1.pyc File 2.45 KB 0644
pmPlugin.cpython-36.pyc File 2.45 KB 0644
rhnChannel.cpython-36.opt-1.pyc File 4.39 KB 0644
rhnChannel.cpython-36.pyc File 4.39 KB 0644
rhnHardware.cpython-36.opt-1.pyc File 468 B 0644
rhnHardware.cpython-36.pyc File 468 B 0644
rhnPackageInfo.cpython-36.opt-1.pyc File 1.9 KB 0644
rhnPackageInfo.cpython-36.pyc File 1.9 KB 0644
rhncli.cpython-36.opt-1.pyc File 7.17 KB 0644
rhncli.cpython-36.pyc File 7.17 KB 0644
rhnreg.cpython-36.opt-1.pyc File 27 KB 0644
rhnreg.cpython-36.pyc File 27.25 KB 0644
rhnreg_constants.cpython-36.opt-1.pyc File 13.69 KB 0644
rhnreg_constants.cpython-36.pyc File 13.69 KB 0644
rhnserver.cpython-36.opt-1.pyc File 4.6 KB 0644
rhnserver.cpython-36.pyc File 4.6 KB 0644
rpcServer.cpython-36.opt-1.pyc File 7.27 KB 0644
rpcServer.cpython-36.pyc File 7.27 KB 0644
rpmUtils.cpython-36.opt-1.pyc File 3.11 KB 0644
rpmUtils.cpython-36.pyc File 3.11 KB 0644
transaction.cpython-36.opt-1.pyc File 2.59 KB 0644
transaction.cpython-36.pyc File 2.59 KB 0644
tui.cpython-36.opt-1.pyc File 31.25 KB 0644
tui.cpython-36.pyc File 31.25 KB 0644
up2dateAuth.cpython-36.opt-1.pyc File 7.07 KB 0644
up2dateAuth.cpython-36.pyc File 7.07 KB 0644
up2dateErrors.cpython-36.opt-1.pyc File 13.32 KB 0644
up2dateErrors.cpython-36.pyc File 13.32 KB 0644
up2dateLog.cpython-36.opt-1.pyc File 2.48 KB 0644
up2dateLog.cpython-36.pyc File 2.48 KB 0644
up2dateUtils.cpython-36.opt-1.pyc File 4.06 KB 0644
up2dateUtils.cpython-36.pyc File 4.06 KB 0644