403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.46
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/__pycache__/cs_utils.cpython-36.pyc
3

��b��@s`dZddlZddlZddlmZdZdZdZej�dkr<dZGd	d
�d
e	�Z
Gdd�de	�ZdS)
a
cepko implements easy-to-use communication with CloudSigma's VMs through
a virtual serial port without bothering with formatting the messages
properly nor parsing the output with the specific and sometimes
confusing shell tools for that purpose.

Having the server definition accessible by the VM can ve useful in various
ways. For example it is possible to easily determine from within the VM,
which network interfaces are connected to public and which to private network.
Another use is to pass some data to initial VM setup scripts, like setting the
hostname to the VM name or passing SSH public keys through server meta.

For more information take a look at the Server Context section of CloudSigma
API Docs: http://cloudsigma-docs.readthedocs.org/en/latest/server_context.html
�N)�serial�<�
z
/dev/ttyS1ZWindowsZCOM2c@s:eZdZdZdZd
dd�Zdd�Zdd	d
�Zddd�ZdS)�Cepkozb
    One instance of that object could be use for one or more
    queries to the serial port.
    z<
{}
>�NcCs|dkr|j}t|j|��S)N)�request_pattern�CepkoResult�format)�self�keyr�r�/usr/lib/python3.6/cs_utils.py�get,sz	Cepko.getcCs|j�S)N)r)r
rrr
�all1sz	Cepko.allcCs|jjd�}|j||�S)Nz/meta/{})rr	r)r
rrrrr
�meta4sz
Cepko.metacCs|jjd�}|j||�S)Nz/global_context/{})rr	r)r
rrrrr
�global_context8szCepko.global_context)rN)r)r)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
r$s

rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz�
    CepkoResult executes the request to the virtual serial port as soon
    as the instance is initialized and stores the result in both raw and
    marshalled format.
    cCs"||_|j�|_|j|j�|_dS)N)�request�_execute�
raw_result�_marshal�result)r
rrrr
�__init__Ds
zCepkoResult.__init__cCs6tjtttd�}|j|jjd��|j�j	d�j
d�S)N)ZportZtimeoutZwriteTimeout�asciis
)rZSerial�SERIAL_PORT�READ_TIMEOUT�
WRITE_TIMEOUT�writer�encode�readline�strip�decode)r
Z
connectionrrr
rIszCepkoResult._executecCs$y
tj|�Stk
r|SXdS)N)�json�loads�
ValueError)r
rrrr
rPs
zCepkoResult._marshalcCs
|jj�S)N)r�__len__)r
rrr
r(VszCepkoResult.__len__cCs|jj|�S)N)r�__getitem__)r
rrrr
r)YszCepkoResult.__getitem__cCs|jj|�S)N)r�__contains__)r
�itemrrr
r*\szCepkoResult.__contains__cCs
|jj�S)N)r�__iter__)r
rrr
r,_szCepkoResult.__iter__N)rrrrrrrr(r)r*r,rrrr
r=sr)rr%�platformZ	cloudinitrrrr�system�objectrrrrrr
�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit