%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/qemu_img.pyc |
� ���^c @@ sY d Z d d l m Z m Z m Z d d l Z d d l Z d � Z d � Z d � Z d S( u Qemu-img Command Wrapper ======================== The qemu img command is wrapped for specific functions :depends: qemu-img i ( t absolute_importt print_functiont unicode_literalsNc C@ s# t j j j d � r d St d f S( u, Only load if qemu-img is installed u qemu-imgu qemu_imguW The qemu_img execution module cannot be loaded: the qemu-img binary is not in the path.( t saltt utilst patht whicht False( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/qemu_img.pyt __virtual__ s c C@ se t j j | � s d St j j t j j | � � s8 d St d d j | | | � d t �sa | Sd S( u? Create a blank virtual machine image file of the specified size in megabytes. The image can be created in any format supported by qemu CLI Example: .. code-block:: bash salt '*' qemu_img.make_image /tmp/image.qcow 2048 qcow2 salt '*' qemu_img.make_image /tmp/image.raw 10240 raw u u cmd.retcodeu qemu-img create -f {0} {1} {2}Mt python_shell( t osR t isabst isdirt dirnamet __salt__t formatR ( t locationt sizet fmt( ( s9 /usr/lib/python2.7/site-packages/salt/modules/qemu_img.pyt make_image s c C@ sN d d d | | | f } t d | d t �} | d d k rB t S| d Sd S( u� Convert an existing disk image to another format using qemu-img CLI Example: .. code-block:: bash salt '*' qemu_img.convert /path/to/original.img /path/to/new.img qcow2 u qemu-imgu convertu -Ou cmd.run_allR u retcodei u stderrN( R R t True( t origt destR t cmdt ret( ( s9 /usr/lib/python2.7/site-packages/salt/modules/qemu_img.pyt convert6 s ( t __doc__t __future__R R R R t salt.utils.pathR R R R ( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/qemu_img.pyt <module> s