[Qemu-devel] [PATCH 7/9] iotests.py: tiny refactor: move system imports up

Vladimir Sementsov-Ogievskiy posted 9 patches 7 years, 8 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 7/9] iotests.py: tiny refactor: move system imports up
Posted by Vladimir Sementsov-Ogievskiy 7 years, 8 months ago
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/iotests.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1bcc9ca57d..c1302a2f9b 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -23,13 +23,14 @@ import subprocess
 import string
 import unittest
 import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
-import qtest
 import struct
 import json
 import signal
 import logging
 
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
+import qtest
+
 
 # This will not work if arguments contain spaces but is necessary if we
 # want to support the override options that ./check supports.
-- 
2.11.1


Re: [Qemu-devel] [PATCH 7/9] iotests.py: tiny refactor: move system imports up
Posted by Eric Blake 7 years, 8 months ago
On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote:
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   tests/qemu-iotests/iotests.py | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

What breaks if they aren't moved?  But stylistically, this looks 
reasonable; and can be merged independently of NBD stuff if someone else 
wants.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 7/9] iotests.py: tiny refactor: move system imports up
Posted by Vladimir Sementsov-Ogievskiy 7 years, 7 months ago
16.02.2018 23:44, Eric Blake wrote:
> On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote:
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   tests/qemu-iotests/iotests.py | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> What breaks if they aren't moved?  But stylistically, this looks 
> reasonable; and can be merged independently of NBD stuff if someone 
> else wants.

This movement also make it a bit nearer to PEP8, as it dislike "E402 
module level import not at top of file", because of "sys.path.append" 
before imports.. So, I'd just saved as many imports as I could)

>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>


-- 
Best regards,
Vladimir