[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: handle TapdiskException when add device failed



>>> On 20.03.14 at 12:38, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> On Thu, Mar 20, 2014 at 06:36:54PM +0800, æä wrote:
>> diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
>> index 5ed781c..d28fb68 100644
>> --- a/tools/python/xen/xm/main.py
>> +++ b/tools/python/xen/xm/main.py
>> @@ -2650,6 +2650,18 @@ def parse_block_configuration(args):
>>  def xm_block_attach(args):
>>      arg_check(args, 'block-attach', 4, 5)
>> 
>> +    uname=args[1]
>> +    uname_list=uname.split(":")
>> +    back_dev=uname_list[len(uname_list)-1]
>> +    front_dev=args[2] if ("/dev" in args[2]) else ("/dev/" + args[2])
> 
> Coding style: need space between "=".
> 
> And hardcoding a path in code is not very good practice. Further more
> what's the rationale to restrict everything in "/dev"? Isn't the most
> rationale thing to do is for user to use the exact path he / she
> provides?

And iirc this kind of conditional isn't being supported by all Python
versions we support.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.