[virt-tools-list] argparse and Python 2.6

Programmingkid programmingkidx at gmail.com
Sun May 8 02:53:16 UTC 2016


On May 7, 2016, at 7:31 PM, Cole Robinson wrote:

> On 05/06/2016 11:51 AM, Programmingkid wrote:
>> 
>> On May 6, 2016, at 7:52 AM, Cole Robinson wrote:
>> 
>>> On 05/05/2016 10:49 PM, Programmingkid wrote:
>>>> I was trying to run virt-clone.py, when I encountered an error. This file uses argparse. This feature was not added to Python until 2.7. I'm using Python 2.6. The INSTALL document says python >= 2.6 is needed. The simplest way to fix this problem is to update the INSTALL document to say "python >= 2.7". Does this sound like the correct solution?
>>> 
>>> Thanks for the report. Yes updating the docs is the best fix
>>> 
>>> - Cole
>> 
>> Thank you very much for helping. Would you know if there is a python script that tries to detect what requirements for Virt-Manager is missing? If there isn't one, I could make one myself.
>> 
> 
> Hmm, interesting idea but not really sure where it would best live. We can put
> it in setup.py, but then my recommendation to people that want to use
> virt-manager.git is just to run virt-manager right from the git repo without
> invoking setup.py, which wouldn't get the benefit. Not sure if you have any
> thoughts
> 
> - Cole

My idea for a verify_system_requirements() function is something like this:

if gtk+3 not found
	tell user to install gtk+ v3.6 or higher

if gtk+ version < 3.6
	tell user to upgrade gtk+ to at least version 3.6

if python version < 2.7
	tell user to upgrade python to at least version 2.7

if python version >= 3.0
	tell user this program might not be compatible with python 3    * not sure about this

if pygobject3 not found
	tell user to install pygobject version 3.4 or higher

if pygobject version < 3.4
	tell user to upgrade pygobject to at least version 3.4

if libosinfo not found
	tell user to install libosinfo 0.2.10 or higher

if libosinfo version < 0.2.10
	tell user to upgrade libosinfo to at least v0.2.10

Once this is turned into a patch, finding out exactly what is wrong with Virt-manager will be easy.

I am not sure about libvirt-python. I think it might be possible to use Virt-manager with QEMU in emulation mode, without needing libvirt.




More information about the virt-tools-list mailing list