+
    i   c                   sJ    ^ RI t ^ RIt^ RIt^ RIHtHtHt  ! R R]]4      tR# )i    N)PluginUbuntuPlugin	PluginOptc            
       s   a  ] tR t^t o RtRtRtRtRt]	! RR]
RR7      ]	! RR	]R
R7      ]	! RR]RR7      ]	! RR]RR7      .tRtR tR tR tRtV tR# )Jujua  The Juju plugin is aimed at collecting Juju-related logs,
configurations, and controller/model state(s).

Logs and agent configuration information (/var/log/juju and /var/lib/juju)
is collected by default since these are useful for troubleshooting.

The Juju state collection is disabled by default and can be enabled with
the 'juju-state' option. Collecting Juju state is safe in theory, but it
does act on the live controller(s)/model(s) and is therefore optional.

The default Juju state collection collects all controllers and models that
the 'juju-user' (default=ubuntu) has access to.

Specific controllers or models can be collected using the 'controllers'
and 'models' options.

Important: the string list is whitespace delimited, not colon delimited
(sos plugin standard). This is due to the underlying Juju CLI accepting
specific models in the format 'controller:model' and whitespaces are not
allowed in either controller and model names.

Example: models="controller_a:model_x controller_b:model_y"
zJuju orchestration toolZjuju
juju-stateFz Include Juju state in the report)ZdefaultZval_typeZdesc	juju-userZubuntuzJuju client user.controllers z[Collect Juju state for specified controllers. Uses a             whitespace delimited list.modelszVCollect Juju state for specified models. Uses a whitespace             delimited list.c                s   V P                  R 4       F%  pV P                  V4       V P                  V4       K'  	  RRRRRRRRR	R
RRRRRRRR/	pV P                  R4      '       d<   VP	                  4        F'  w  r4V P                  V P                  V4      VR7       K)  	  V P                  R4       V P                  RR.RR7       V P                  R4      '       d7   V P                  . R1O4       V P                  R4       V P                  R4       MV P                  R4       V P                  R4      '       g   R# V P                  R 4      p \        P                  ! V4       T P                  R#4      '       d+   T P                  R$4      '       d   T P                  R%4       R# T P                  R&TR'7      pTR(,          ^ 8X  dy   \!        T P                  R#4      P#                  R)4      4      pT'       d   TR*08w  d   TpM>\!        \$        P&                  ! TR+,          4      R#,          P)                  4       4      pM/ pT P                  R$4      '       dB   T P                  R$4      P#                  R)4       F  p	R,T	 R-2p
T P                  YR'7       K  	  R# T F{  pT P+                  R.T R-2TR'7      pTR(,          ^ 8X  g   K*  \$        P&                  ! TR+,          4      R$,          pT F'  p	T	R/,          pR,T R0T R-2p
T P                  YR'7       K)  	  K}  	  R#   \         d    T P                  R!T R"24        R# i ; i)2zjuju*Zjuju_engine_reportZ	depengineZjuju_goroutineszdebug/pprof/goroutine?debug=1Zjuju_heap_profilezdebug/pprof/heap?debug=1Zjuju_metricsZmetricsZjuju_pubsub_reportZpubsubZjuju_presence_reportZpresenceZjuju_statepool_reportZ	statepoolZjuju_statetracker_reportz&debug/pprof/juju/state/tracker?debug=1Zjuju_unit_statuszunits?action=status/var/lib/juju/agents)Zsuggest_filenamez!/var/lib/juju/agents/*/agent.confz/var/log/juju*z/var/lib/juju*T)Z	recursiveZall_logsz/var/lib/juju/kvmz/var/lib/juju/toolsz/var/log/juju/*.logr   Nr   zUser "z4" does not exist, will not collect Juju information.r   r   zWOptions: controllers, models are mutually exclusive. Will not collect Juju information.zjuju controllers --format=json)ZrunasZstatus r   Zoutputzjuju status -m z --format=jsonzjuju models --all -c z
short-nameZ:)/var/log/jujuz/var/lib/jujuz/var/lib/juju/**/.*)Zget_service_namesZadd_journalZadd_service_statusZpath_existsZitemsZadd_cmd_output_juju_agentZadd_copy_specZadd_dir_listingZ
get_optionZadd_forbidden_pathpwdZgetpwnamZKeyErrorZ	_log_warnZcollect_cmd_outputZsetZsplitjsonZloadsZkeysZexec_cmd)selfZserviceZjuju_agent_cmdsZcmdZ	agent_cmdZ	juju_userZcontrollers_jsonZdesired_controllersr   ZmodelcommandZ
controllerZmodels_jsonr   Z
short_names   &              </usr/lib/python3.14/site-packages/sos/report/plugins/juju.pysetupZ
Juju.setupR   s`    --g6GW%##G, 7
 !+>!;I ("J#[& *3 5
 233"1"7"7"9##$$Y/%( $  #: 	>? 	
  	 	
 ??:&&    
 ##$78##$9: 45 |,,OOK0		LL# ??=))dooh.G.GNN5 22,I 3 
 H%*"%.44S9#
 #':rd'B1!JJ/9:%df K ??8$$288=+E7.A##G#= > *
"mm+J<~F# ,  x(A-!ZZH(=>xHF!'%*<%8
-j\:, G, -   ++G+E "( *W  	NN $5 5 	s   L  M Mc                s    V P                   R 8X  d>   V P                  R4       F(  p\        P                  ! RV4      '       g   K"  W n          M	  RV P                    RV 2# )r   r	   z$machine-*|controller-*|application-*zjuju-introspect --agent=r
   )
agent_nameZlistdirreZsearch)r   r   Zdir_names   && r   r   ZJuju._juju_agent   sW    ??b  LL)?@99CXNN&.O A
 *$//):!G9EE    c                s    R p. R
OpRRP                  V4       R2pRpV P                  WV4       V P                  RRR4       V P                  V4       V P                  R4       R	# )z/var/lib/juju/agents/*z(^\s*(Z|z)\s*:\s*)(.*)z\1*********z,/var/log/juju/unit-nova-compute-(.*).log(.*)zauth\(key=(.*)\)zauth(key=******)zjuju controllersN)ZsharedsecretZapipasswordZoldpasswordZstatepassword)ZjoinZdo_path_regex_subZdo_file_private_subZdo_cmd_private_sub)r   Zagents_pathZprotect_keysZ
keys_regexZ	sub_regexs   &    r   postprocZJuju.postproc   sv    .
 sxx56mD
"	{	B 	M24G	I 	  - 23r   )r   N)ZvirtZsysmgmt)r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z
short_descZplugin_nameZprofilesZfilesr   ZboolZstrZoption_listr   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s     0 +JK#H E 	3		
 	$		
 	(		
 			
)K: JsFjF4 4r   r   )r   r   r   Zsos.report.pluginsr    r   r   r   ) r   r   <module>r      s&      	 > >S46< S4r   