File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/xapi_virt.cpython-310.pyc
Back
o ;j_ � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl mZ dZdd� Z dd� Zejd d � �Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� ZdMdd�ZdMdd�Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Z d+d,� Z!d-d.� Z"d/d0� Z#d1d2� Z$d3d4� Z%d5d6� Z&d7d8� Z'd9d:� Z(d;d<� Z)d=d>� Z*dNdAdB�Z+dCdD� Z,dEdF� Z-dMdGdH�Z.dMdIdJ�Z/dMdKdL�Z0dS )Oa� This module (mostly) uses the XenAPI to manage Xen virtual machines. Big fat warning: the XenAPI used in this file is the one bundled with Xen Source, NOT XenServer nor Xen Cloud Platform. As a matter of fact it *will* fail under those platforms. From what I've read, little work is needed to adapt this code to XS/XCP, mostly playing with XenAPI version, but as XCP is not taking precedence on Xen Source on many platforms, please keep compatibility in mind. Useful documentation: . http://downloads.xen.org/Wiki/XenAPI/xenapi-1.0.6.pdf . http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/ . https://github.com/xapi-project/xen-api/tree/master/scripts/examples/python . http://xenbits.xen.org/gitweb/?p=xen.git;a=tree;f=tools/python/xen/xm;hb=HEAD � N)�CommandExecutionErrorZvirtc C st t d dkr'd} tj�| �r'tjj�| �}d|� d�}tj�|�r't j� |� zt�d�W S t tfy9 Y dS w )N�osZDebianz#/usr/lib/xen-common/bin/xen-versionz /usr/lib/xen-z/lib/pythonz xen.xm.XenAPIF)� __grains__r �path�isfile�salt�modulesZcmdmodZ _run_quiet�isdir�sys�append� importlib� import_module�ImportError�AttributeError)Zdebian_xen_versionZ xenversionZxapipath� r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/xapi_virt.py� _check_xenapi'