+
    Û1j 3  ã                   óh   € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt	 ^ RIH
t
  ! R R]4      tR# )é    N)ÚSoSComponent)Ú_sos)Ú__version__c                   ó"  a a€ ] tR t^t oRtRt/ RRbRRbRRbRR	bR
R	bRR	bRR	bRRbRRbRRbRRbRR	bRR	bRR	bRR	bRR	bRR	btR'V 3R llt]R 4       t	]R 4       t
R tR tR tR tR  t]R! 4       t]R" 4       t]R# 4       tR$ tR% tR&tVtV ;t# )(Ú	SoSUploadzÉ
This class is designed to upload files to a distribution
defined location. These files can be either sos reports,
sos collections, or other kind of files like: vmcores,
application cores, logs, etc.

z9Upload a file to a user or policy defined remote locationÚupload_fileÚ Úcase_idÚlow_priorityFÚ
upload_urlNÚupload_directoryÚupload_userÚupload_passÚupload_methodÚautoÚupload_no_ssl_verifyÚupload_protocolÚupload_s3_endpointzhttps://s3.amazonaws.comÚupload_s3_regionÚupload_s3_bucketÚupload_s3_access_keyÚupload_s3_secret_keyÚupload_s3_object_prefixÚupload_targetc                óT  <€ V'       g   \         SV `  WV4       R V n        MjVR,          V n        VR,          V n        VR,          V n        Wn        W0n        W n        W`n	        \        P                  ! R4      V n        RV n        W`n        V P                  4       V n        RV n        R# )TÚoptionsÚpolicyÚmanifestÚsos_uiFN)ÚsuperÚ__init__Úfrom_cmdlineÚoptsr   r   ÚparserÚcmdlineÚargsÚ_upload_fileÚloggingÚ	getLoggerÚui_logÚarchiveÚload_upload_targetsÚupload_targetsr   )Úselfr$   r&   r%   Úin_placeÚhook_commonsr+   Ú	__class__s   &&&&&&&€Ú5/usr/lib/python3/dist-packages/sos/upload/__init__.pyr!   ÚSoSUpload.__init__5   s�   ø€ çä‰GÑ˜V¨7Ô3Ø $ˆDÕð
 % YÕ/ˆDŒIØ& xÕ0ˆDŒKØ(¨Õ4ˆDŒMØ ŒKØ"ŒLØŒIØ 'Ôä!×+Ò+¨HÓ5ˆDŒKØ %ˆDÔØ"ŒLØ"×6Ñ6Ó8ˆÔØ!ˆÖó    c                óÐ  € R Vn         VP                  RR4      pVP                  RRRR7       VP                  RRR	R
R7       VP                  RRRR7       VP                  RRRR7       VP                  RRRR7       VP                  RRRRR7       VP                  RRRR7       VP                  RRRR7       VP                  RRRR7       VP                  RRRR7       VP                  RRR R7       VP                  R!RR"R7       VP                  R#R$. R1OR%R&7       VP                  R'R$. R2OR(R&7       VP                  R)R*R+R,R-7       VP                  R.R/. R3OR0R&7       R# )4zsos upload FILE [options]zUpload Optionsz.These options control how upload manages filesr   ÚFILEzThe file or archive to upload)ÚmetavarÚhelpz	--case-idÚstorer
   zspecify case identifier)ÚactionÚdestr8   z--upload-urlNz&Upload the archive to specified server)Údefaultr8   z--upload-userzUsername to authenticate withz--upload-passzPassword to authenticate withz--upload-directoryr   z$Specify upload directory for archivez--upload-s3-endpointz#Endpoint to upload to for S3 bucketz--upload-s3-regionz!Region to upload to for S3 bucketz--upload-s3-bucketz"Name of the S3 bucket to upload toz--upload-s3-access-keyzAccess key for the S3 bucketz--upload-s3-secret-keyzSecret key for the S3 bucketz--upload-s3-object-prefixzPrefix for the S3 object/keyz--upload-methodr   z HTTP method to use for uploading)r<   Úchoicesr8   z--upload-protocolz$Manually specify the upload protocolz--upload-no-ssl-verifyFÚ
store_truez'Disable SSL verification for upload url)r<   r:   r8   z--upload-targetÚlocalzmManually specify vendor-specific target for uploads. Supported options are:
redhat, canonical, generic, local)r   ÚputÚpost)r   ÚhttpsÚftpÚsftpÚs3)ÚredhatÚ	canonicalÚgenericr?   )ÚusageÚadd_argument_groupÚadd_argument)Úclsr$   Ú
upload_grps   && r2   Úadd_parser_optionsÚSoSUpload.add_parser_optionsM   sø  € à2ˆŒØ×.Ñ.ØØ<óˆ
ð 	×Ñ °vØ%Dð 	 ô 	Fà×Ñ °GÀ)Ø%>ð 	 ô 	@à×Ñ ¸Ø%Mð 	 ô 	Oà×Ñ ¸Ø%Dð 	 ô 	Fà×Ñ ¸Ø%Dð 	 ô 	Fà×ÑÐ 4¸WØ%7Ø%Kð 	 ô 	Mð 	×ÑÐ 6ÀØ%Jð 	 ô 	Là×ÑÐ 4¸dØ%Hð 	 ô 	Jà×ÑÐ 4¸dØ%Ið 	 ô 	Kà×ÑÐ 8À$Ø%Cð 	 ô 	Eà×ÑÐ 8À$Ø%Cð 	 ô 	Eà×ÑÐ ;ÀTØ%Cð 	 ô 	Eà×ÑÐ 1¸6Ú(?Ø%Gð 	 ô 	Ið 	×ÑÐ 3¸VÚ(NØ%Kð 	 ô 	Mð 	×ÑÐ 8À%Ø'3Ø%Nð 	 ô 	Pð 	×ÑÐ 1¸7ò)-ð
'7ð 	 ö 
	9r4   c                óJ   € VP                  R 4       VP                  R4       R# )zSoS Upload Detailed Helpz˜The upload command is designed to upload already existing sos reports, as well as other files like logs and vmcores to a distribution specific location.N)Ú	set_titleÚadd_text)rL   Úsections   &&r2   Údisplay_helpÚSoSUpload.display_help‚   s$   € à×ÑÐ4Ô5à×Ñð3ö	
r4   c                óÊ  € RpV P                   P                  R\         R24       V P                  V4      pV P                   P                  V4       RpV P                  P
                  '       g*    \        V4       V P                   P                  R4       R# R#   \         d    T P                  R^‚4        R# \         d   pT P                  T^4        Rp?R# Rp?ii ; i)z]Print the intro message and prompts for a case ID if one is not
provided on the command line
a}  This utility is used to upload files to a target location based either on a command line option or detecting the local distribution.

The archive to be uploaded may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party.

No configuration changes will be made to the system running this utility.
z
sos upload (version Ú)z,
Press ENTER to continue, or CTRL-C to quit
r	   úExiting on user cancelN)
r*   Úinfor   Ú_fmt_msgr#   ÚbatchÚinputÚKeyboardInterruptÚ_exitÚ	Exception)r.   Ú
disclaimerÚ	intro_msgÚpromptÚes   &    r2   ÚintroÚSoSUpload.introŒ   s¶   € ðˆ
ð 	�‰×ÑÐ1´+°¸aÐ@ÔAØ—M‘M *Ó-ˆ	Ø�‰×Ñ˜Ô#àAˆØ�y‰y��ˆð!Ü�f”Ø—‘× Ñ  Ö$ñ øô %ô :Ø—
‘
Ð3°S×9Üô !Ø—
‘
˜1˜a× Ò ûð!ús$   Á1&B ÂC"Â;C"ÃC"ÃCÃC"c                óŽ   € R V P                   RV P                  RV P                   P                  RV P                   P                  /# )Úcmdlineoptsr   r
   r   )r#   r   r
   r   )r.   s   &r2   Úget_commonsÚSoSUpload.get_commonsª   s<   € à˜4Ÿ9™9Ø�d—k‘kØ�t—y‘y×(Ñ(Ø §	¡	× :Ñ :ð	
ð 	
r4   c                ó   € Wn         R# )z9Set common host data for the Upload targets
to reference
N)Úcommons)r.   rk   s   &&r2   Úset_commonsÚSoSUpload.set_commons²   s	   € ð Žr4   c                ób  € \        V P                  P                  4       4      pV P                  P                  4        F|  pVP                  V4       VP	                  4       '       g   K,  VP
                  P                  pV P                  P                  RV R24       W n	        VP                  4       V n        K~  	  V P                  '       g8   V P                  R,          V n	        V P                  P                  4       V n        V P                  P                  RV P                   24       R# )zÜThis sets the upload target and loads that target's options.

If no upload target is matched and no target is provided by
the user, then we abort.

If an upload target is provided in the command line,
this will not run.
zInstallation matches z, checking for upload targetsrH   zUpload target set to N)Úlistr-   ÚvaluesÚremoveÚcheck_distributionr1   Ú__name__r*   Údebugr   ÚnameÚupload_namerY   )r.   Úchecksr   Úcnames   &   r2   Údetermine_upload_targetÚ!SoSUpload.determine_upload_target¸   sù   € ô �d×)Ñ)×0Ñ0Ó2Ó3ˆØ!×0Ñ0×7Ñ7Ö9ˆMØ�M‰M˜-Ô(Ø×/Ñ/×1Ô1Ø%×/Ñ/×8Ñ8�Ø—‘×!Ñ!Ð$9¸%¸ð A4ð #4ô 5à%2Ô"Ø#0×#5Ñ#5Ó#7�Ö ñ :ð ×!×!Ð!Ø!%×!4Ñ!4°YÕ!?ˆDÔØ#×1Ñ1×6Ñ6Ó8ˆDÔØ�‰×ÑØ+¨D×,<Ñ,<Ð+=Ð>ö	@r4   c                ó.  € ^ RI p/ pV P                  VP                  P                  R4       Fd  pV^,          ! V P                  V P
                  V P                  R7      pVP                  V P                  4       4       WBVP                  4       &   Kf  	  V# )zELoads all upload targets supported by the local installation
        NÚtargets)r$   r&   r%   )
Úsos.upload.targetsÚ_load_modulesÚuploadr|   r$   r&   r%   rl   rh   Úget_target_id)r.   ÚsosÚsupported_upload_tgtsr   Útarget_classs   &    r2   r,   ÚSoSUpload.load_upload_targetsÐ   s…   € ó 	"Ø "ÐØ!×/Ñ/°·
±
×0BÑ0BÀIÖNˆMØ(¨Ö+Ø#'§;¡;Ø!%§¡Ø$(§L¡LôˆLð
 ×$Ñ$ T×%5Ñ%5Ó%7Ô8ØBN ,×"<Ñ"<Ó">Ó?ñ Oð %Ð$r4   c                ó¾   € . pVP                    FJ  p\        P                  P                  V4      '       g   K*  VP	                  V P                  WB4      4       KL  	  V# )zHelper to import upload targets)Ú__path__ÚosÚpathÚisdirÚextendÚ_find_modules_in_path)rL   ÚpackageÚsubmodÚmodulesrˆ   s   &&&  r2   r~   ÚSoSUpload._load_modulesß   sJ   € ð ˆØ×$Ô$ˆDÜ�w‰w�}‰}˜T×"Ô"Ø—‘˜s×8Ñ8¸ÓFÖGñ %ð ˆr4   c                óv  € . p\         P                  P                  V4      '       d’   \        \         P                  ! V4      4       Fn  pVP                  R4      '       g   K  RV9   d   K%  \         P                  P                  V4      w  rVRV RV 2pVP                  V P                  V4      4       Kp  	  V# )a%  Given a path and a module name, find everything that can be imported
and then import it

    path - the filesystem path of the package
    modulename - the name of the module in the package

E.G. a path of 'targets', and a modulename of 'redhat' equates to
importing sos.upload.targets.redhat
z.pyÚ__zsos.upload.Ú.)	r‡   rˆ   ÚexistsÚsortedÚlistdirÚendswithÚsplitextrŠ   Ú_import_modules)rL   rˆ   Ú
modulenamerŽ   ÚpyfileÚfnameÚ_Úmodnames   &&&     r2   r‹   ÚSoSUpload._find_modules_in_pathè   s–   € ð ˆÜ�7‰7�>‰>˜$×ÒÜ ¤§¢¨DÓ!1Ö2�Ø—‘ u×-Ò-ÙØ˜6”>ÙÜŸ7™7×+Ñ+¨FÓ3‘�Ø'¨
 |°1°U°GÐ<�Ø—‘˜s×2Ñ2°7Ó;Ö<ñ 3ð ˆr4   c                óö   € \         P                  ! V4      p\        P                  ! V\        P                  4       UU u. uF+  w  r0V P
                  P                  R4      '       g   K(  W03NK-  	  ppp V# u up pi )z/Import and return all found classes in a modulezsos.upload.targets)Ú	importlibÚimport_moduleÚinspectÚ
getmembersÚisclassÚ
__module__Ú
startswith)rL   r�   Úmoduleru   rŽ   s   &&   r2   r˜   ÚSoSUpload._import_modulesÿ   sl   € ô ×(Ò(¨Ó1ˆô %×/Ò/°¼¿¹ÔHô
áH‘	�Ø�~‰~×(Ñ(Ð)=×>ô ˆT‹KÙHð 	ñ 
ð
 ˆùó
s   ¿%A5Á)A5c                ó²   € V P                  4       V n        V P                  R ,          pVP                  '       d   V P                  P	                  4        R# R# )rg   N)rh   rk   r   r   Ú_configure_low_priority)r.   Úcmdline_optss   & r2   Úpre_workÚSoSUpload.pre_work
  sA   € à×'Ñ'Ó)ˆŒØ—|‘| MÕ2ˆà×$×$Ð$Ø�K‰K×/Ñ/Ö1ñ %r4   c           
     ó8  €  V P                  4        V P                  '       dW   V P                  4        V P                  P                  V n        V P                  P                  V P                  R 7      V n        V P                  P                  pV'       d!   VR8w  d   V P                  V,          V n	        MV P                  4        V P                  '       g2   V P                  P                  R4       \        P                  ! ^4       V P                  P                  V P!                  4       4        \"        P$                  ! V P
                  4      P&                  ^ 8”  d½   \"        P(                  P+                  V P
                  4      '       d[    V P                  P-                  V P
                  4       V P                  P/                  \1        RV P
                   R24      4       R# V P                  P                  \1        V P
                   R24      4       R# V P                  P                  \1        RV P
                   R24      4       R#   \2         dI   pT P                  P                  \1        RT 24      4       \        P                  ! ^4        Rp?R# Rp?ii ; i  \2         dA   pT P                  P                  \1        R	T P
                   R
T R24      4        Rp?R# Rp?ii ; i  \4         d    T P7                  R^‚4        R# i ; i))r«   r?   z|No upload target set via command line options or autodetected.
Please specify one using the option --upload-target.
Exiting.zFile z uploaded successfullyzUpload attempt failed: Nz is not a file.z
 is empty.zCannot upload z: Ú rX   )r¬   r"   rd   r#   r   r+   r   Úprompt_for_case_idÚcaseidr   r-   ry   r*   ÚerrorÚsysÚexitrh   r‡   ÚstatÚst_sizerˆ   ÚisfileÚupload_archiverY   rœ   r_   r]   r^   )r.   Úcmdline_targetÚerrrc   s   &   r2   ÚexecuteÚSoSUpload.execute  sG  € ð+	6Ø�M‰MŒOØ× × Ð Ø—
‘
”Ø#Ÿy™y×4Ñ4�”Ø"Ÿk™k×<Ñ<Ø!%§¡ð =ó �”ð "ŸY™Y×4Ñ4ˆNß .°GÔ";Ø%)×%8Ñ%8¸Õ%H�Õ"à×,Ñ,Ô.Ø×%×%Ð%ð —‘×!Ñ!ðôô —’˜”Ø×Ñ×'Ñ'¨×(8Ñ(8Ó(:Ô;ðLÜ—7’7˜4Ÿ<™<Ó(×0Ñ0°1Ô4Ü—w‘w—~‘~ d§l¡l×3Ò3ð(Ø ×.Ñ.×=Ñ=¸d¿l¹lÔKØ ŸK™K×,Ñ,Ü ! E¨$¯,©,¨Ð7MÐ"NÓ Oöð Ÿ™×)Ñ)¬!¨t¯|©|¨n¸OÐ,LÓ*MÖNà—K‘K×%Ñ%¤a¨%°·±¨~¸ZÐ(HÓ&IÖJøô  )ô (Ø ŸK™K×-Ñ-¬aØ"9¸#¸Ð ?ó/Aô BäŸHšH QŸKšKûð(ûô ô LØ—‘×!Ñ!¤! n°T·\±\°NÀ"ÀQÀCÀqÐ$IÓ"J×KÒKûðLûä ô 	6Ø�J‰JÐ/°×5ð	6ús{   ‚!K8 ¤A3K8 ÂAK8 ÃAK8 Ä5AJ* ÆAI Ç-1J* È 2J* ÉJ'É=J"ÊJ* Ê"J'Ê'J* Ê*K5Ê55K0Ë*K8 Ë0K5Ë5K8 Ë8LÌL)r'   r+   r&   r±   r%   rk   r"   r   r#   r$   r   r*   rv   r   r-   )NNNFNN)rs   r¥   Ú__qualname__Ú__firstlineno__Ú__doc__ÚdescÚarg_defaultsr!   ÚclassmethodrN   rT   rd   rh   rl   ry   r,   r~   r‹   r˜   r¬   r»   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r1   Ú__classdict__s   @@r2   r   r      su  ù‡ € ñð K€DðØ�rðà�2ðð 	˜ðð 	�dð	ð
 	˜Dðð 	�tðð 	�tðð 	˜ðð 	 ðð 	˜6ðð 	Ð8ðð 	˜Dðð 	˜Dðð 	 ðð 	 ðð  	" 4ð!ð" 	˜ð#€L÷("ð0 ñ29ó ð29ðh ñ
ó ð
ò!ò<
òò@ò0%ð ñó ðð ñó ðð, ñó ðò2÷,6ò ,6r4   r   )r‡   r³   r(   r¢   r    Úsos.componentr   r�   r   rœ   r   r   © r4   r2   Ú<module>rÉ      s-   ðó 
Û 
Û Û Û å &Ý Ý ôh6�ö h6r4   