/usr/lib/python3/dist-packages/sos/collector/transports/__pycache__
NameSizeModeActions
control_persist.cpython-310.pyc70450644editdlrm
juju.cpython-310.pyc31240644editdlrm
local.cpython-310.pyc18730644editdlrm
oc.cpython-310.pyc65060644editdlrm
saltstack.cpython-310.pyc56970644editdlrm
__init__.cpython-310.pyc148720644editdlrm
Edit: /usr/lib/python3/dist-packages/sos/collector/transports/__pycache__/juju.cpython-310.pyc (3124B)
o G%@i @s@ddlZddlmZddlmZddlmZGdddeZdS)N)JujuNotInstalledException)RemoteTransport)sos_get_command_outputc@sbeZdZdZdZdZddZddZdd d Zd d Z e d dZ e ddZ ddZ ddZdS)JujuSSHa A "transport" that leverages `juju ssh` to perform commands on the remote hosts. This transport is expected to be used in juju managed environment, and the user should have the necessary credential for accessing the controller. When using this transport, the --nodes option will be expected to be a comma separated machine IDs, **not** IP addr, since `juju ssh` identifies the ssh target by machine ID. Examples: sos collect --nodes 0,1,2 --no-local --transport juju --batch juju_sshubuntuc CsHd}z tj|tjddWdStjy#}z|dt|d}~ww)Nz juju versionTstderrshellzFailed to check `juju` version) subprocess check_outputSTDOUTCalledProcessError log_errorr)selfcmderrr?/usr/lib/python3/dist-packages/sos/collector/transports/juju.py_check_juju_installed's zJujuSSH._check_juju_installedcCsN|jd|}z tj|tjddWdStjy&|d|dw)Nz sudo chmod o+r TrzFailed to make z world-readable) remote_execr r r rr)rfnamerrrr_chmod0szJujuSSH._chmodcCs||_|jSN)r _connected)rpasswordrrr_connect9s zJujuSSH._connectcCsdS)NTrrrrr _disconnect=szJujuSSH._disconnectcCs|jSr)rrrrr connected@szJujuSSH.connectedcCs:|jd\}}|rd|nd}|d|}d|S)N:-m r z juju ssh )addresssplit)rmodel target_option model_optionoptionrrrrDs zJujuSSH.remote_execcCsV|jd\}}|rd|nd}d|d|d|d|}t|dd}|d d kS) Nr!r"r juju scp z -- r#)timeoutstatusr)r$r%rrrdestr&unitr(rresrrr_copy_file_to_remoteKs   zJujuSSH._copy_file_to_remotecCs\|||jd\}}|rd|nd}d|d|d|d|}t|}|ddkS) Nr!r"rr*z -- -r r#r-r)rr$r%rr.rrr_retrieve_fileRs  zJujuSSH._retrieve_fileN)r)__name__ __module__ __qualname____doc__name default_userrrrrpropertyr rr2r3rrrrrs    r)r sos.collector.exceptionsrsos.collector.transportsr sos.utilitiesrrrrrrs