PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/pyone/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/pyone/__pycache__/helpers.cpython-312.pyc

�

���g���J�ddlmZddlmZmZddlmZGd�de�Zd	d�Zy)
�)�OneException)�MARKETPLACEAPP_STATES�MARKETPLACEAPP_TYPES�)�	b64decodec��eZdZy)�OneHelperExceptionN)�__name__�
__module__�__qualname__���</opt/hc_python/lib/python3.12/site-packages/pyone/helpers.pyr	r	s��rr	Nc��ddd�}|sH|jj�}|jD]}|jdk(s�|j}n|std��|jj|�}|jtjk7rtd��|jtjk(r�|jr$t|j�j�}	nd}	|s|j}|	d||jfzz
}	|j j#|	|�|d<d	|j$vr_t|j$d	�j�}
|s|j}|
d
||dfzz
}
|j&j#|
�|d<|Stdt|j�j(z��)
aS
    Exports a market app to a suitable OpenNebula object
    :param one: the XMLRPC server
    :param appid: id of the marketplace app
    :param dsid: id of the datastore to save images, if not provided the datastore named "default" will be used.
    :param name: name of the new object, if not provided the same name as the App will be used
    :param vmtemplate_name: name for the VM Template, if the app has one.
    :return: a dictionary with the ID of the new Image as image and the ID of the new associated template as vmtemplate. If no template has been defined, it will return -1.
    ���)�image�
vmtemplate�defaultz<Datastore was not provided and could not find the defaultonez!Application is not in READY state�z
NAME="%s"
FROM_APP="%d"r�VMTEMPLATE64z!
NAME="%s"
DISK=[ IMAGE_ID = %d ]rzApp type %s not supported)�
datastorepool�info�	DATASTORE�NAME�IDr	�	marketapp�STATEr�READY�TYPEr�IMAGE�
APPTEMPLATE64r�decoder�allocate�TEMPLATE�template�name)�one�appid�dsidr&�vmtemplate_name�ret�
datastores�ds�app�templ�vmtempls           r�marketapp_exportr1s�����
�C���&�&�+�+�-�
��&�&�B��w�w�)�#��u�u���'�� �!_�`�`��-�-�
�
�U�
#�C�
�y�y�)�/�/�/� �!D�E�E�
�x�x�'�-�-�-�����C�-�-�.�5�5�7�E��E���8�8�D�
�/�4����-�?�?���y�y�)�)�%��5��G���S�\�\�)�����^� <�=�D�D�F�G�"�"%�(�(���@�O�UX�Y`�Ua�Cb�b�b�G� #��� 5� 5�g� >�C���
�J�!�!<�?S�TW�T\�T\�?]�?b�?b�!b�c�cr)NNN)rrrr�base64rr	r1r
rr�<module>r3s!�� �9��	��	�;r

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic