Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
share
/
rhsm
/
subscription_manager
/
Upload File :
New :
File
Dir
//proc/self/root/usr/share/rhsm/subscription_manager/managerlib.pyo
mò x^Sc�����������@���s³��d��k��Z��d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d�k�l �Z �d�k �l�Z�l�Z�l �Z �d��k�i�Z�d�k�l�Z�l�Z�d�k�l�Z�d�k�l�Z�d�k�l�Z�d�k�l�Z�l�Z�l�Z�l�Z�l�Z�l �Z �l!�Z!�l"�Z"�l#�Z#�l$�Z$�l%�Z%�d�k�l&�Z&�d �k'�l(�Z(�d �k)�l*�Z*�d�k+�l,�Z,�d�k-�l.�Z.�e�i/�d �e0�ƒ�Z1�e��i��Z2�e �ƒ��Z3�e3�i4�d�d�ƒ�Z5�e�i6�e�i7�Be�i8�BZ9�e�i:�d�„�Z�d�„��Z;�d�„��Z<�d�e=�f�d�„��ƒ��YZ>�d�„��Z?�d�e@�f�d�„��ƒ��YZA�eB�d��d�„�ZD�eB�d��eB�eB�d��d�„�ZE�d�e@�f�d�„��ƒ��YZF�d�„��ZG�d�e�f�d�„��ƒ��YZH�d�e@�f�d �„��ƒ��YZI�d!�e@�f�d"�„��ƒ��YZJ�d��d#�„�ZK�d$�„��ZL�d%�„��ZM�d&�„��ZN�eO�d'�„�ZP�d(�„��ZQ�d)�„��ZR�d��S(*���N(���s ���initConfig(���s���Keys���CertificateExceptions���create_from_pem(���s���StackingGroupSorters���ComplianceManager(���s���certlib(���s ���system_log(���s���Facts(���s���requires���CERT_SORTERs���PRODUCT_DATE_RANGE_CALCULATORs���IDENTITYs���ENTITLEMENT_STATUS_CACHEs���PROD_STATUS_CACHEs���ENT_DIRs���PROD_DIRs���CP_PROVIDERs���OVERRIDE_STATUS_CACHEs���POOLTYPE_CACHE(���s���isodate(���s���PoolWrapper(���s���RepoLib(���s ���is_true_value(���s���ConsumerIdentitys ���rhsm-app.t���rhsmt���entitlementCertDirc���������C���s���t��|��|�ƒ�d��S(���N(���t���inner_system_logt���messaget���priority(���R���R���(����(����t2���/usr/share/rhsm/subscription_manager/managerlib.pyt ���system_log7���s����c���������C���s¯���t��i�d�d�ƒ�}�t�i�i�|�ƒ�p�t�i�|�ƒ�n�t�i�|��d�d�|��d�d�ƒ�}�|�i�ƒ��h��d�|�i�ƒ��<d�|�i �ƒ��<}�t�i�d�|�ƒ�t�d �|�i �ƒ��ƒ�|�S(���sF��� Calls the consumerIdentity, persists and gets consumer info R����t���consumerCertDirt���idCertt���keyt���certt ���consumer_namet���uuids���Consumer created: %ss#���Registered system with identity: %sN(���t���cfgt���gett���cert_dirt���ost���patht���isdirt���mkdirt���certlibt���ConsumerIdentityt���consumerinfot���consumert���writet���getConsumerNamet ���getConsumerIdt ���consumer_infot���logt���infoR���(���R���R���R���R���(����(����R���t���persist_consumer_cert;���s����� $c��� ��� ���C���sü���g��} �t�t�ƒ�}�t�t�|�ƒ�}�xÔ�|�i�D]É�} �|�i�| �}�x³�|�i �D]¨�}�d�}�d�}�|�i�|�i�ƒ�}�|�o(�t�|�i�ƒ��ƒ�}�t�|�i �ƒ��ƒ�}�n�|�i�| �|�i�d�i�|�i�ƒ�|�i�|�i�ƒ�|�i�i�|�ƒ�|�|�f�}�| �i�|�ƒ�qH�Wq+�W| �S(���sG��� Returns the Installed products and their subscription states t����t���,N(���t���product_statust���requiret���CERT_SORTERt���sortert���PRODUCT_DATE_RANGE_CALCULATORt���uept ���calculatort���installed_productst���installed_productt���product_certt���productst���productt���begint���endt ���calculatet���idt���prod_status_ranget���format_datet���namet���versiont���joint ���architecturest ���get_statust���reasonst���get_product_reasonst���datat���append( ���t���product_directoryt���entitlement_directoryR&���R,���R.���R:���R1���R-���R$���R)���R!���R*���R'���(����(����R���t���get_installed_product_statusL���s$����� � �Ht���CertificateFetchErrorc�����������B���s���t��Z�d�„��Z�d�d�„�Z�RS(���Nc���������C���s ���|�|��_��d��S(���N(���t���errorst���self(���RA���R@���(����(����R���t���__init__n���s����R���c���������C���s���d�d�i��|��i�ƒ�}�|�S(���NsG���Entitlement Certificate(s) update failed due to the following reasons: s��� (���R5���RA���R@���t���msg(���RA���t���reasonRC���(����(����R���t���__str__q���s����(���t���__name__t ���__module__RB���RE���(����(����(����R���R?���m���s��� c���������C���s/���|��i�ƒ��}�|�d�o�t�|�d�ƒ�‚�n�t�S(���Ni���(���R���t���updatet���resultR?���t���True(���R���RI���(����(����R���t���fetch_certificatesw���s����t ���PoolFilterc�����������B���st���t��Z�d��Z�e�d�„�Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �d�„��Z �d�„��Z�d �„��Z�d �„��Z �d�„��Z�RS(���s+��� Helper to filter a list of pools. c���������C���s���|�|��_�|�|��_�|�|��_�d��S(���N(���t���product_dirRA���R<���t���entitlement_dirR=���R$���(���RA���RM���RN���R$���(����(����R���RB���†���s���� c���������C���s¢���g��}�x•�|�D]�}�|�d�|�j�o)�t�i�d�|�d�ƒ�|�i�|�ƒ�q �n�xJ�|�d�D]>�}�|�d�|�j�o'�t�i�d�|�d�ƒ�|�i�|�ƒ�PqX�qX�Wq �W|�S(���sÐ��� Filter a list of pools and return just those that provide products in the requested list of product ids. Both the top level product and all provided products will be checked. t ���productIds���pool matches: %st���providedProductss���pool provides: %sN(���t ���matched_poolst���poolst���poolt���product_idsR���t���debugR;���t���provided(���RA���RR���RT���RV���RQ���RS���(����(����R���t���filter_product_idsŒ���s������ � c��� ������C���s¶���|��i�i�ƒ��}�h��}�x”�|�D]Œ�}�xƒ�|�D]{�}�|�i�d�i �} �g��}�|�d�D]�}�|�|�d�qN�~�}�t�| �ƒ�|�j�p�t�| �ƒ�|�d�j�o�|�|�|�d�<q)�q)�Wq�W|�i�ƒ��S(���s}��� Filter the given list of pools, return only those which provide a product installed on this system. i����RP���RO���R0���N(���RA���R<���t���listR(���t���matched_data_dictRR���t���dR,���R+���R0���t ���productidt���_[1]t���pt���provided_idst���strt���values( ���RA���RR���R,���RZ���R(���R\���R]���RY���R^���R[���(����(����R���t���filter_out_uninstalled ���s�������)*c��� ������C���sÂ���|��i�i�ƒ��}�h��}�x �|�D]˜�}�|�|�|�d�<g��}�|�d�D]�}�|�|�d�q?�~�}�xX�|�D]P�}�|�i�d�i�} �t�| �ƒ�|�j�p�t�| �ƒ�|�d�j�o�|�|�d�=Pq`�q`�Wq�W|�i�ƒ��S(���s„��� Filter the given list of pools, return only those which do not provide a product installed on this system. R0���RP���RO���i����N(���RA���R<���RX���R(���RY���RR���RZ���R\���R]���R^���R,���R+���R0���R[���R_���R`���( ���RA���RR���R,���RZ���R(���R\���R]���RY���R^���R[���(����(����R���t���filter_out_installed´���s������)�* c���������C���s���|�i�ƒ��}�g��}�xt�|�D]l�}�|�|�d�i�ƒ��j�o�|�i�|�ƒ�q�x;�|�d�D]/�}�|�|�d�i�ƒ��j�o�|�i�|�ƒ�PqR�qR�Wq�W|�S(���s|��� Filter the given list of pools, removing those whose product name does not contain the given text. t���productNameRP���N(���t ���contains_textt���lowert���loweredt���filtered_poolsRR���RS���R;���RV���(���RA���RR���Rd���RV���Rf���Rg���RS���(����(����R���t���filter_product_nameÈ���s������� c���������C���sH���g��}�x;�|��i�i�ƒ��D]*�}�x!�|�i�D]�}�|�i�|�i�ƒ�q&�Wq�W|�S(���N( ���t���entitled_productsRA���R=���RX���R ���R+���R,���R;���R0���(���RA���R,���R ���Ri���(����(����R���t���_get_entitled_product_idsÙ���s����� �c���������C���sp���h��}�xc�|��i�i�ƒ��D]R�}�xI�|�i�D]>�}�|�i�}�|�|�j�o�t �ƒ��|�|�<n�|�|�i �|�ƒ�q&�Wq�W|�S(���N(���t���entitled_products_to_certsRA���R=���RX���R ���R+���R,���R0���t���prod_idt���sett���add(���RA���R,���Rk���Rl���R ���(����(����R���t!���_get_entitled_product_to_cert_mapà���s����� � c���������C���sl���t��i�|�d�ƒ�}�t��i�|�d�ƒ�}�x?�|�D]7�}�|�i�}�|�i �|�ƒ�p�|�i �|�ƒ�o�t �Sq-�q-�Wt�S(���Nt ���startDatet���endDate(���t���isodatet ���parse_dateRS���t ���pool_startt���pool_endt���certsR ���t���valid_ranget ���cert_ranget���has_dateRJ���t���False(���RA���RS���Rv���Ru���Rx���Rt���R ���(����(����R���t���_dates_overlapê���s����� c��� ������C���sý���|��i�ƒ��}�g��}�xä�|�D]Ü�}�g��}�|�d�D]�}�|�|�d�q.�~�}�t �}�xŒ�|�i�ƒ��D]~�} �t �| �ƒ�|�j�p�t �| �ƒ�|�d�j�oN�|��i�|�|�| �ƒ�o3�|��i�o�| �|��i�i�j�p�|��i�o�t�}�PqÙ�q[�q[�W|�p�|�i�|�ƒ�q�q�W|�S(���NRP���RO���(���RA���Ro���t���entitled_product_ids_to_certsRg���RR���RS���R\���R]���R^���Rz���t���overlapt���keysR[���R_���R{���R$���t���valid_productsRJ���R;���( ���RA���RR���R}���R\���R]���RS���Rg���R|���R^���R[���(����(����R���t���filter_out_overlappingô���s�����) �*? c���������C���s?���|��i�|�ƒ�}�g��}�|�D]�}�|�|�j�o�|�|�q�q�~�S(���N(���RA���R€���RR���t���not_overlappingR\���RS���(���RA���RR���R\���R���RS���(����(����R���t���filter_out_non_overlapping��s����c���������C���sy���g��}�|�i�ƒ��D]�}�|�|�d�q�~�}�g��}�xA�|�D]9�}�|�d�|�j�p�|�d�|�j�o�|�i�|�ƒ�q8�q8�W|�S(���sÄ��� Filter the given list of pools, removing those for which the system already has a subscription, unless the pool can be subscribed to again (ie has multi-entitle). R0���N( ���R\���t���compatible_poolsR`���RS���t���resubscribeable_pool_idsRg���RR���t���subscribed_pool_idsR;���(���RA���RR���R…���Rƒ���R„���R\���Rg���RS���(����(����R���t���filter_subscribed_pools ��s�����+�"(���RF���RG���t���__doc__t���NoneRB���RW���Ra���Rb���Rh���Rj���Ro���R{���R€���R‚���R†���(����(����(����R���RL���€���s���� c������ ���C���sg���|�i�|��|�ƒ�t�i�ƒ��}�|�i�|��|�ƒ�|��i�|�ƒ�}�|�d�}�|��i �d�|�d�|�d�|�d�|�ƒ�S(���sù��� Wrapper around the UEP call to fetch pools, which forces a facts update if anything has changed before making the request. This ensures the rule checks server side will have the most up to date info about the consumer possible. R ���R���t���listAllt ���active_ont���ownerN( ���t���factst���update_checkR&���t ���consumer_uuidt���cachet���ProfileManagert���profile_mgrt���getOwnerR‹���t���owneridt���getPoolsListt���list_allRŠ���(���R&���RŽ���RŒ���R•���RŠ���R‘���R‹���R“���(����(����R���t ���list_pools��s����� c������ ���C���sß��d�d�d�d�d�d�d�d�d �d �d�d�d �g �} �t�t�t�t�ƒ�t�t�ƒ�ƒ�ƒ�}�|�i�|�|�|�|�|�ƒ�}�x¼�|�D]´�}�t�|�ƒ�}�|�i�ƒ��|�d�<t�|�ƒ�o�d�|�d�<n�d�|�d�<|�i�d�d�ƒ�}�|�d�|�d �<|�d�|�d�<|�i�ƒ��|�d�<|�i�ƒ��|�d �<|�d�d�j�o�d�|�d�<qq�qq�Wg��} �|�D]�}�| �t�|�| �ƒ�q4~ �} �x…�| �D]}�}�t�|�d�ƒ�d�j��o�t�d�ƒ�|�d�<n)�t�t�|�d�ƒ�t�|�d�ƒ�ƒ�|�d�<t�t �i!�|�d�ƒ�ƒ�|�d�<|�d�=qZW| �S(���sX�� Returns a list of entitlement pools from the server. Facts will be updated if appropriate before making the request, to ensure the rules on the server will pass if appropriate. The 'all' setting can be used to return all pools, even if the rules do not pass. (i.e. show pools that are incompatible for your hardware) R0���t���quantityt���consumedRq���Rc���RP���RO���t ���attributest ���pool_typet ���service_levelt���service_typet ���suggestedt���contractNumbert���Yess���multi-entitlementt���Not ���support_levelt���support_typeR���i����t ���UnlimitedN("���t���columnst ���PoolStasht���FactsR"���t���ENT_DIRt���PROD_DIRt ���pool_stasht���get_filtered_pools_listRŠ���t���get_allt���overlappingt���uninstalledt���textt���dlistRS���t���PoolWrappert���pool_wrappert���get_provided_productst���allows_multi_entitlementt���get_product_attributest ���support_attrst���get_suggested_quantityt ���get_pool_typeRˆ���R\���t ���_sub_dictR:���RZ���t���intt���_R_���R2���Rr���Rs���(���RŒ���R«���RŠ���R¬���R���R®���Rµ���R¯���R©���R¤���R:���RS���RZ���R\���R±���(����(����R���t���get_available_entitlements0��s:���� �-! � *�(t���MergedPoolsc�����������B���s2���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���s¥��� Class to track the view of merged pools for the same product. Used to view total entitlement information across all pools for a particular product. c���������C���s:���|�|��_��|�|��_�d�|��_�d�|��_�d�|��_�g��|��_�d��S(���Ni����(���t ���product_idRA���t���product_namet���bundled_productsR—���R˜���RR���(���RA���R½���R¾���(����(����R���RB���i��s���� c���������C���s���|��i�|�d�7_�|�d�d�j�o �d�|��_�n(�|��i�d�j�o�|��i�|�d�7_�n�|��i�i�|�ƒ�t�|�d�ƒ�|��_�d��S(���NR˜���R—���iÿÿÿÿRP���(���RA���R˜���RS���R—���RR���R;���t���lenR¿���(���RA���RS���(����(����R���t���add_poolq��s���� c���������C���sC���x<�|�d�D]0�}�|�d�d�j�o�|�d�d�j�o�d�Sq�q�Wd�S( ���sÍ��� Used to sort the pools, return Physical or Virt depending on the value or existence of the virt_only attribute. Returning numeric values to simulate the behavior we want. R™���R3���t ���virt_onlyt���valuet���truei���i���N(���RS���t���attr(���RA���RS���RÅ���(����(����R���t���_virt_physical_sorter…��s������"c���������C���s���|��i�i�d�|��i�ƒ�d�S(���sš��� Prioritizes virt pools to the front of the list, if any are present. Used by contract selector to show these first in the list. R ���N(���RA���RR���t���sortRÆ���(���RA���(����(����R���t���sort_virt_to_top‘��s�����(���RF���RG���R‡���RB���RÁ���RÆ���RÈ���(����(����(����R���R¼���c��s ���� c���������C���sd���h��}�xW�|��D]O�}�|�d�|�j�o#�t�|�d�|�d�ƒ�|�|�d�<n�|�|�d�i�|�ƒ�q �W|�S(���sj�� Merges the given pools into a data structure representing the totals for a particular product, across all pools for that product. This provides an overview for a given product, how many total entitlements you have available and in use across all subscriptions for that product. Returns a dict mapping product ID to MergedPools object. RO���Rc���N(���t���merged_poolsRR���RS���R¼���RÁ���(���RR���RÉ���RS���(����(����R���t���merge_poolsš��s���� �� t���MergedPoolsStackingGroupSorterc�����������B���s)���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�RS(���s<��� Sorts a list of MergedPool objects by stacking_id. c���������C���s���t��i�|��|�ƒ�d��S(���N(���t���StackingGroupSorterRB���RA���RÉ���(���RA���RÉ���(����(����R���RB���¶��s����c���������C���s���t��|�i�d�ƒ�i�ƒ��S(���Ni����(���R°���t���merged_poolRR���t���get_stacking_id(���RA���RÍ���(����(����R���t���_get_stacking_id¹��s����c���������C���s���|�i�d�d�S(���Ni����Rc���(���RÍ���RR���(���RA���RÍ���(����(����R���t���_get_identity_name¼��s����(���RF���RG���R‡���RB���RÏ���RÐ���(����(����(����R���RË���²��s���� R¥���c�����������B���se���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�e �e �e �e �e �d�„�Z�d�„��Z�RS( ���sš��� Object used to fetch pools from the server, sort them into compatible, incompatible, and installed lists. Also does filtering based on name. c���������C���sI���t��t�ƒ�|��_�|�|��_�d��|��_�h��|��_�h��|��_�g��|��_ �h��|��_ �d��S(���N(���R"���t���IDENTITYRA���t���identityRŒ���Rˆ���R$���Rƒ���t���incompatible_poolsR…���t ���all_pools(���RA���RŒ���(����(����R���RB���Å��s���� c���������C���s ���t��|��i�ƒ�S(���N(���RÀ���RA���RÔ���(���RA���(����(����R���t���all_pools_sizeÖ��s����c���������C���s´��|�o�t�|�ƒ�|��_�n�t�t�ƒ�|��_�h��|��_�h��|��_�t�i �d�ƒ�xW�t �t�t�ƒ�i�ƒ��|��i �i�|��i�d�|�ƒD](�}�|�|��i�|�d�<|�|��i�|�d�<qv�Wh��|��_�xu�t �t�t�ƒ�i�ƒ��|��i �i�|��i�d�t�d�|�ƒD]@�}�|�d�|��i�j�o&�|�|��i�|�d�<|�|��i�|�d�<qß�qß�W|��i�ƒ��|��_�t�t�ƒ�i�|��i�ƒ�t�i �d�t�|��i�ƒ�ƒ�t�i �d�t�|��i�ƒ�ƒ�t�i �d�t�|��i�ƒ�ƒ�t�i �d�t�|��i�ƒ�ƒ�d �S( ���sV��� Refresh the list of pools from the server, active on the given date. s���Refreshing pools from server...RŠ���R0���R•���s���found %s pools:s��� %s compatibles��� %s incompatibles��� %s already subscribedN(���RŠ���t���ComplianceManagerRA���R$���R"���R#���RÔ���Rƒ���R���RU���R–���t���CP_PROVIDERt���get_consumer_auth_cpRÒ���R���RŒ���RS���RÓ���RJ���t���_get_subscribed_pool_idsR…���t���POOLTYPE_CACHEt���update_from_poolsRÀ���(���RA���RŠ���RS���(����(����R���t���refreshÙ��s2����� � �c���������C���s��h��|��_�h��|��_�|�o�|�o�t�|�ƒ�|��_�n#�|�o�|�o�t�t�ƒ�|��_�n�|�oM�x™�t �t�t�ƒ�i�ƒ��|��i �i�|��i�d�|�ƒD]�}�|�|��i�|�d�<qŠ�WnP�xL�t �t�t�ƒ�i�ƒ��|��i �i�|��i�d�t�d�|�ƒD]�}�|�|��i�|�d�<qÝ�W|��i�|�|�|�t�|�ƒ�S(���sS��� Used for CLI --available filtering cuts down on api calls RŠ���R0���R•���N(���RA���RÔ���Rƒ���RŠ���R¬���RÖ���R$���R"���R#���t���incompatibleR–���R×���RØ���RÒ���R���RŒ���RS���RJ���t ���_filter_poolsR���Rz���R®���(���RA���RŠ���RÝ���R¬���R���R®���RS���(����(����R���Rª���þ��s"����� ��c���������C���s1���g��}�t�t�ƒ�i�ƒ��D]�}�|�|�i�i�q�~�S(���N(���R\���R"���R§���RX���t���entRS���R0���(���RA���R\���Rß���(����(����R���RÙ�����s����c��� ������C���sÅ��t��i�d�t�|��i�ƒ�ƒ�|�p�|��i�i�ƒ��}�n*�|��i�i�ƒ��}�t��i�d�t�|��i �ƒ�ƒ�t �t�t�ƒ�t�t �ƒ�|��i�ƒ�}�|�o:�t�|�ƒ�}�|�i�|�ƒ�}�t��i�d�|�t�|�ƒ�ƒ�n�|�o:�t�|�ƒ�}�|�i�|�ƒ�}�t��i�d�|�t�|�ƒ�ƒ�n�|�o=�t�|�ƒ�}�|�i�|�|�ƒ�}�t��i�d�|�t�|�ƒ�ƒ�n�|�oF�t�|�ƒ�}�|�i�|�|��i�|��i�ƒ�}�t��i�d�|�t�|�ƒ�ƒ�n�t��i�d�t�|�ƒ�t�|��i�ƒ�t�|�ƒ�f�ƒ�|�S( ���s´��� Return a list of pool hashes, filtered according to the given options. This method does not actually hit the server, filtering is done in memory. s���Filtering %d total poolss��� Removed %d incompatible poolss,��� Removed %d pools for not installed productss3��� Removed %d pools overlapping existing entitlementss0��� Removed %d pools not matching the search strings2��� Removed %d pools that we're already subscribed tos%��� %d pools to display, %d filtered outN(���R���RU���RÀ���RA���RÔ���RÝ���R`���RR���Rƒ���RÓ���RL���R"���R¨���R§���R$���t���pool_filterR���t���prev_lengthRa���R¬���R€���R®���Rh���t ���subscribedR†���R…���( ���RA���RÝ���R¬���R���Râ���R®���Rà���Rá���RR���(����(����R���RÞ�����s6����� 0c���������C���s+���|��i�|�|�|�|�|�ƒ�}�t�|�ƒ�}�|�S(���s �� Return a merged view of pools filtered according to the given options. Pools for the same product will be merged into a MergedPool object. Arguments turn on filters, so setting one to True will reduce the number of results. N( ���RA���RÞ���RÝ���R¬���R���Râ���R®���RR���RÊ���RÉ���(���RA���RÝ���R¬���R���Râ���R®���RÉ���RR���(����(����R���RÊ���M��s �����c���������C���s\���|��i�|�}�|�d�j�o�d�Sn�g��}�x-�|�d�D]!�}�|�i�|�d�|�d�f�ƒ�q3�W|�S(���s¿��� Return a list of tuples (product name, product id) for all products provided for a given pool. If we do not actually have any info on this pool, return None. RP���Rc���RO���N(���RA���RÔ���t���pool_idRS���Rˆ���t���provided_productsR,���R;���(���RA���Rã���Rä���R,���RS���(����(����R���t���lookup_provided_products[��s����� �( ���RF���RG���R‡���RB���RÕ���RÜ���Rª���RÙ���RÞ���Rz���Rˆ���RÊ���Rå���(����(����(����R���R¥���À��s���� % 4t���ImportFileExtractorc�����������B���sÏ���t��Z�d��Z�d�Z�d�Z�d�Z�d�e�e�e�f�Z�e�i�e�ƒ�Z �d�Z �d�Z�d�Z�d�Z �d �„��Z�d �„��Z�d�„��Z�d�„��Z�d �„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���sJ�� Responsible for checking an import file and pulling cert and key from it. An import file may include only the certificate, but may also include its key. An import file is processed looking for: -----BEGIN <TAG>----- <CONTENT> .. -----END <TAG>----- and will only process if it finds CERTIFICATE or KEY in the <TAG> text. For example the following would locate a key and cert. -----BEGIN CERTIFICATE----- <CERT_CONTENT> -----END CERTIFICATE----- -----BEGIN PUBLIC KEY----- <KEY_CONTENT> -----END PUBLIC KEY----- t���startt���contentR.���sC���(?P<%s>[-]*BEGIN[\w\ ]*[-]*)(?P<%s>[^-]*)(?P<%s>[-]*END[\w\ ]*[-]*)t���CERTIFICATEt���KEYt���ENTITLEMENTs ���RSA SIGNATUREc���������C���sC���|�|��_�t�i�i�|�ƒ�|��_�|��i�|�ƒ�}�|��i�|�ƒ�|��_ �d��S(���N( ���t���cert_file_pathRA���R���R���t���basenamet ���file_namet���_readRè���t���_process_contentt���parts(���RA���Rì���Rè���(����(����R���RB�����s���� c���������C���s)���t��|�d�ƒ�}�|�i�ƒ��}�|�i�ƒ��|�S(���Nt���r(���t���opent ���file_patht���fdt���readt���file_contentt���close(���RA���Rô���R÷���Rõ���(����(����R���Rï���—��s���� c��� ������C���s'��h��}�|��i�i�|�ƒ�}�x|�D]�}�|�i�|��i�ƒ�}�|�i�|��i �ƒ�}�|�i�|��i�ƒ�}�d��}�|�i�|��i�ƒ�d�j��p �|��i�}�ns�|�i�|��i�ƒ�d�j��p �|��i�}�nM�|�i�|��i�ƒ�d�j��p �|��i�}�n'�|�i�|��i�ƒ�d�j��p �|��i�}�n�|�d��j�o�q�n�|�|�|�|�|�<q�W|�S(���Ni����(���t ���part_dictRA���t���_PATTERNt���finditerRè���t���matchest���matcht���groupt���_REGEX_START_GROUPRç���t���_REGEX_CONTENT_GROUPt���meatt���_REGEX_END_GROUPR.���Rˆ���t���dict_keyt���findt ���_KEY_DICT_TAGt���_CERT_DICT_TAGt ���_ENT_DICT_TAGt ���_SIG_DICT_TAG( ���RA���Rè���R.���R��Rü���Rù���Rç���R��Rý���(����(����R���Rð�����s(����� c���������C���s���|��i�|��i�j�S(���N(���RA���R��Rñ���(���RA���(����(����R���t���contains_key_contentµ��s����c���������C���s1���d��}�|��i�|��i�j�o�|��i�|��i�}�n�|�S(���N(���Rˆ���t���key_contentRA���R��Rñ���(���RA���R ��(����(����R���t���get_key_content¸��s����c���������C���s•���d��}�|��i�|��i�j�o�|��i�|��i�}�n�|��i�|��i�j�o�|�t�i�|��i�|��i�}�n�|��i�|��i�j�o�|�t�i�|��i�|��i�}�n�|�S(���N( ���Rˆ���t���cert_contentRA���R��Rñ���R��R���t���linesepR��(���RA���R��(����(����R���t���get_cert_content¾��s����c���������C���sm���y(�|��i�ƒ��}�t�|�d�ƒ�p�t�Sn�Wn�t�j �o�t�Sn�Xt�|��i�ƒ��ƒ�}�|�i �ƒ��o�t�Sn�t �S(���sr��� Verify that a valid entitlement was processed. @return: True if valid, False otherwise. t���orderN(���RA���t���get_certR ���t���hasattrRz���t���CertificateExceptiont���KeyR��t���ent_keyt���bogusRJ���(���RA���R��R ���(����(����R���t���verify_valid_entitlementÈ��s����� c���������C���s���|��i�ƒ��t�i�i�t�|��i�ƒ��ƒ�}�t�i �d�|�ƒ�|��i �ƒ��}�|��i�|�|�ƒ�|��i �ƒ��o:�|��i�|�ƒ�}�t�i �d�|�ƒ�|��i�|�|��i�ƒ��ƒ�n�d�S(���s>��� Write/copy cert to the entitlement cert dir. s���Writing certificate file: %ss���Writing key file: %sN(���RA���t���_ensure_entitlement_dir_existsR���R���R5���t���ENT_CONFIG_DIRt(���_create_filename_from_cert_serial_numbert���dest_file_pathR���RU���R��R��t���_write_fileR ��t!���_get_key_path_from_dest_cert_patht���dest_key_file_pathR��(���RA���R��R��R��(����(����R���t ���write_to_diskÛ��s����� c���������C���s2���t��|�d�ƒ�}�z�|�i�|�ƒ�Wd��|�i�ƒ��Xd��S(���Nt���w(���Ró���t���target_patht���new_fileR���Rè���Rø���(���RA���R ��Rè���R!��(����(����R���R��í��s �����c���������C���s+���t��i�t�t��i�ƒ�p�t��i�t�ƒ�n�d��S(���N(���R���t���accessR��t���R_OKR���(���RA���(����(����R���R��ô��s����c���������C���s&���t��i�i�|�ƒ�}�|�d�d�|�d�S(���Ni����s���-keyi���(���R���R���t���splitextt���dest_cert_patht ���file_parts(���RA���R%��R&��(����(����R���R��ø��s����c���������C���s���|��i�ƒ��}�d�|�i�S(���s���create from serials���%s.pemN(���RA���R��t���ent_certt���serial(���RA���R'��(����(����R���R��ü��s�����c���������C���s���|��i�ƒ��}�t�|�ƒ�}�|�S(���N(���RA���R��R��t���create_from_pemR'��(���RA���R'��R��(����(����R���R����s����(���RF���RG���R‡���Rÿ���R���R��t���_REGEXt���ret���compileRú���R��R��R��R��RB���Rï���Rð���R ��R��R��R��R��R��R��R��R��R��(����(����(����R���Ræ���k��s.���� c���������C���s7���t��g��}�|�D]�}�|�|�|��i�|�|�ƒ�f�q�~�ƒ�S(���sL���Return a dict that is a subset of datadict matching only the keys in subkeysN(���t���dictR\���t���subkeyst���kt���datadictR���t���default(���R0��R.��R1��R\���R/��(����(����R���R¸�����s�����c���������C���s���|��op�y<�y�d�k�l�}�Wn�d�Sn�X|��i�|�ƒ��ƒ�i�d�ƒ�SWq{�t�j �o!�t�i�d�ƒ�|��i�d�ƒ�Sq{�Xn�d�Sd��S(���N(���s���tzlocalR���s���%xs.���Datetime does not contain timezone information(���t���dtt���dateutil.tzt���tzlocalt ���astimezonet���strftimet ���ValueErrorR���t���warn(���R2��R4��(����(����R���R2�����s���� c���������C���s9���|��i�|�ƒ�t�i�d�ƒ�t�d�|�ƒ�t�d�t�ƒ�d�S(���s+��� Shared logic for un-registration. s���Successfully un-registered.s&���Unregistered machine with identity: %st���backupN(���R&���t���unregisterConsumerRŽ���R���R���R���t���clean_all_dataRz���(���R&���RŽ���(����(����R���t ���unregister��s ����� c����������C���sô���t��i�i�ƒ��t��i�i�ƒ��g�}�xÏ�|�D]Ç�}��t�i�i�|��ƒ�p�q%�n�t�i �|��ƒ�}�|�t �i�d�j�p�|�t �i�d�j�o(�t�i �|��d�d�ƒ�t�i�d�|��ƒ�n�t �i�|�t �i�ƒ�}�|�t�j�o%�t�i�|��t�ƒ�t�i�d�|��ƒ�q%�q%�Wd�S(���si��� Ensure the identity certs on this system have the correct permissions, and fix them if not. i����s$���Corrected incorrect ownership of %s.s&���Corrected incorrect permissions on %s.N(���R���R���t���keypatht���certpathRv���R ���R���R���t���existst���statt���statinfot���ST_UIDt���ST_GIDt���chownR���R8��t���S_IMODEt���ST_MODEt���modet ���ID_CERT_PERMSt���chmod(���R ���Rv���RG��RA��(����(����R���t���check_identity_cert_perms%��s������( c���������C���sé��t��i�d�d�ƒ�}�|��on�|�d�d�j�o�|�d�d�!d�}�n�|�d�}�t�i�|�d�t�ƒt�i �d�|�|�f�ƒ�t�i �|�|�ƒ�n�xU�t�i�ƒ��t�i �ƒ��g�D];�}�t�i�i�|�ƒ�o"�t�i�d �|�ƒ�t�i�|�ƒ�q �q �Wt�t�ƒ�i�ƒ��t��i�d�d �ƒ�}�t�i�i�|�ƒ�oU�xc�t�i�d�|�ƒ�D]9�}�t�i�i�|�|�ƒ�}�t�i�d�|�ƒ�t�i�|�ƒ�q(Wn�t�i�d �|�ƒ�t�i�i�ƒ��t�i�i�ƒ��t�i�ƒ��t�t �ƒ�i�ƒ��t�t!�ƒ�i�ƒ��t�t"�ƒ�i�ƒ��t#�i$�ƒ��t�i �d�ƒ�d��S(���NR����R���iÿÿÿÿt���/i����s���.oldt ���ignore_errorss���Backing up %s to %s.s���Removing identity cert: %sR���s���%s/*.pems���Removing entitlement cert: %ss-���Entitlement cert directory does not exist: %ss���Cleaned local data(%���R ���R���t���consumer_dirR9��t���consumer_dir_backupt���shutilt���rmtreeRJ���R���R���t���copytreeR���R=��R>��R���R���R?��RU���t���removeR"���RÑ���t���reloadt���ent_cert_dirt���globt���fR5���R8��R���R���t���delete_cachet���InstalledProductsManagerR¦���t���ENTITLEMENT_STATUS_CACHEt���PROD_STATUS_CACHEt���OVERRIDE_STATUS_CACHEt���RepoLibt���delete_repo_file(���R9��R���RT��R>��RN��RV��RM��(����(����R���R;��:��s<���� �� c���������C���sA���|��p�t�Sn�y�t�|��ƒ�d�j�SWn�t�j �o�t�Sn�Xd��S(���Ni����(���R—���Rz���R¹���R7��(���R—���(����(����R���t���valid_quantityh��s����c���������C���sC���x<�|��d�D]0�}�|�d�d�j�o�t�|�d�ƒ�o�t�Sq�q�Wt�S(���s‚��� Determine if this pool allows multi-entitlement based on the pool's top-level product's multi-entitlement attribute. t���productAttributesR3���s���multi-entitlementRÃ���N(���RS���t ���attributet ���is_true_valueRJ���Rz���(���RS���R`��(����(����R���R³���r��s������"(S���t���gettextRU��t���loggingR���R+��RO��R@��t���syslogt���rhsm.configt ���initConfigt���rhsm.certificateR��R��R)��t���subscription_manager.cacheR���t ���subscription_manager.cert_sorterRÌ���RÖ���t���subscription_managerR���t���subscription_manager.certlibR���R���t���subscription_manager.factsR¦���t���subscription_manager.injectionR"���R#���R%���RÑ���RY��RZ��R§���R¨���R×���R[��RÚ���Rr���t ���subscription_manager.jsonwrapperR°���t���subscription_manager.repolibR\��t���subscription_manager.utilsRa��t���subscription_manager.identityR���t ���getLoggerRF���R���Rº���R ���R���R��t���S_IRUSRt���S_IWUSRt���S_IRGRPRH��t ���LOG_NOTICER���R>���t ���ExceptionR?���RK���t���objectRL���Rz���Rˆ���R–���R»���R¼���RÊ���RË���R¥���Ræ���R¸���R2���R<��RJ��RJ���R;��R^��R³���(;���R���R>���RË���R×���R ���R¸���R���R§���Rd��R?���R[��R%���R\��RZ��R¼���R���RO��RH��R���RÚ���R���RÖ���R^��RÌ���Rb��R+��Ræ���Rº���R��RÊ���R–���R���R;��R¥���R@��Ra��RU��R)��R³���R°���R��R��R¨���RY��R2���RÑ���RL���Rc��RJ��RK���R<��R"���R#���R���Rf��R¦���Rr���R���R»���(����(����R���t���?���sZ��� I ! ›37 «œ .