2019-05-06 17:29:43

by Adrian Vladu

[permalink] [raw]
Subject: [PATCH] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

Fixed pep8/flake8 python style code for lsvmbus tool.

The TAB indentation was on purpose ignored (pep8 rule W191) to make
sure the code is complying with the Linux code guideline.
The following command doe not show any warnings now:
pep8 --ignore=W191 lsvmbus
flake8 --ignore=W191 lsvmbus

Signed-off-by: Adrian Vladu <[email protected]>

Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Sasha Levin <[email protected]>
Cc: Dexuan Cui <[email protected]>
Cc: Alessandro Pilotti <[email protected]>
---
tools/hv/lsvmbus | 75 +++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 33 deletions(-)

diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
index 55e7374bade0..099f2c44dbed 100644
--- a/tools/hv/lsvmbus
+++ b/tools/hv/lsvmbus
@@ -4,10 +4,10 @@
import os
from optparse import OptionParser

+help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
parser = OptionParser()
-parser.add_option("-v", "--verbose", dest="verbose",
- help="print verbose messages. Try -vv, -vvv for \
- more verbose messages", action="count")
+parser.add_option(
+ "-v", "--verbose", dest="verbose", help=help_msg, action="count")

(options, args) = parser.parse_args()

@@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path):
exit(-1)

vmbus_dev_dict = {
- '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system shutdown]',
- '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',
- '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',
- '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',
- '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume checkpoint)]',
- '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',
- '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',
- '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',
- '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',
- '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer adapter',
- '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',
- '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',
- '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',
- '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel adapter',
- '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',
- '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',
- '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',
- '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',
- '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',
+ '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
+ '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
+ '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
+ '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
+ '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
+ '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
+ '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
+ '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
+ '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
+ '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
+ '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
+ '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
+ '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
+ '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
+ '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
+ '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
+ '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
+ '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
+ '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
}

+
def get_vmbus_dev_attr(dev_name, attr):
try:
f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
@@ -52,6 +53,7 @@ def get_vmbus_dev_attr(dev_name, attr):

return lines

+
class VMBus_Dev:
pass

@@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path):

chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
- chn_vp_mapping = sorted(chn_vp_mapping,
- key = lambda c : int(c.split(':')[0]))
+ chn_vp_mapping = sorted(
+ chn_vp_mapping, key=lambda c: int(c.split(':')[0]))

- chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %
- (c.split(':')[0], c.split(':')[1])
- for c in chn_vp_mapping]
+ chn_vp_mapping = [
+ '\tRel_ID=%s, target_cpu=%s' %
+ (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
+ ]
d = VMBus_Dev()
d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
d.vmbus_id = vmbus_id
@@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path):
vmbus_dev_list.append(d)


-vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))
+vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))

format0 = '%2s: %s'
format1 = '%2s: Class_ID = %s - %s\n%s'
@@ -95,9 +98,15 @@ for d in vmbus_dev_list:
if verbose == 0:
print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
elif verbose == 1:
- print (('VMBUS ID ' + format1) % \
- (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))
+ print(
+ ('VMBUS ID ' + format1) %
+ (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
+ )
else:
- print (('VMBUS ID ' + format2) % \
- (d.vmbus_id, d.class_id, d.dev_desc, \
- d.device_id, d.sysfs_path, d.chn_vp_mapping))
+ print(
+ ('VMBUS ID ' + format2) %
+ (
+ d.vmbus_id, d.class_id, d.dev_desc,
+ d.device_id, d.sysfs_path, d.chn_vp_mapping
+ )
+ )
--
2.19.1


2019-05-06 17:35:06

by Adrian Vladu

[permalink] [raw]
Subject: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

Fixed pep8/flake8 python style code for lsvmbus tool.

The TAB indentation was on purpose ignored (pep8 rule W191) to make
sure the code is complying with the Linux code guideline.
The following command do not show any warnings now:
pep8 --ignore=W191 lsvmbus
flake8 --ignore=W191 lsvmbus

Signed-off-by: Adrian Vladu <[email protected]>

Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Sasha Levin <[email protected]>
Cc: Dexuan Cui <[email protected]>
Cc: Alessandro Pilotti <[email protected]>
---
tools/hv/lsvmbus | 75 +++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 33 deletions(-)

diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
index 55e7374bade0..099f2c44dbed 100644
--- a/tools/hv/lsvmbus
+++ b/tools/hv/lsvmbus
@@ -4,10 +4,10 @@
import os
from optparse import OptionParser

+help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
parser = OptionParser()
-parser.add_option("-v", "--verbose", dest="verbose",
- help="print verbose messages. Try -vv, -vvv for \
- more verbose messages", action="count")
+parser.add_option(
+ "-v", "--verbose", dest="verbose", help=help_msg, action="count")

(options, args) = parser.parse_args()

@@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path):
exit(-1)

vmbus_dev_dict = {
- '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system shutdown]',
- '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',
- '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',
- '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',
- '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume checkpoint)]',
- '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',
- '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',
- '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',
- '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',
- '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer adapter',
- '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',
- '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',
- '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',
- '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel adapter',
- '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',
- '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',
- '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',
- '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',
- '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',
+ '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
+ '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
+ '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
+ '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
+ '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
+ '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
+ '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
+ '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
+ '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
+ '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
+ '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
+ '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
+ '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
+ '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
+ '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
+ '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
+ '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
+ '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
+ '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
}

+
def get_vmbus_dev_attr(dev_name, attr):
try:
f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
@@ -52,6 +53,7 @@ def get_vmbus_dev_attr(dev_name, attr):

return lines

+
class VMBus_Dev:
pass

@@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path):

chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
- chn_vp_mapping = sorted(chn_vp_mapping,
- key = lambda c : int(c.split(':')[0]))
+ chn_vp_mapping = sorted(
+ chn_vp_mapping, key=lambda c: int(c.split(':')[0]))

- chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %
- (c.split(':')[0], c.split(':')[1])
- for c in chn_vp_mapping]
+ chn_vp_mapping = [
+ '\tRel_ID=%s, target_cpu=%s' %
+ (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
+ ]
d = VMBus_Dev()
d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
d.vmbus_id = vmbus_id
@@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path):
vmbus_dev_list.append(d)


-vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))
+vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))

format0 = '%2s: %s'
format1 = '%2s: Class_ID = %s - %s\n%s'
@@ -95,9 +98,15 @@ for d in vmbus_dev_list:
if verbose == 0:
print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
elif verbose == 1:
- print (('VMBUS ID ' + format1) % \
- (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))
+ print(
+ ('VMBUS ID ' + format1) %
+ (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
+ )
else:
- print (('VMBUS ID ' + format2) % \
- (d.vmbus_id, d.class_id, d.dev_desc, \
- d.device_id, d.sysfs_path, d.chn_vp_mapping))
+ print(
+ ('VMBUS ID ' + format2) %
+ (
+ d.vmbus_id, d.class_id, d.dev_desc,
+ d.device_id, d.sysfs_path, d.chn_vp_mapping
+ )
+ )
--
2.19.1

2019-05-07 05:05:44

by Dexuan Cui

[permalink] [raw]
Subject: RE: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

> From: Adrian Vladu <[email protected]>
> Sent: Monday, May 6, 2019 10:34 AM
> To: [email protected]
> Cc: Adrian Vladu <[email protected]>; KY Srinivasan
> <[email protected]>; Haiyang Zhang <[email protected]>; Stephen
> Hemminger <[email protected]>; Sasha Levin <[email protected]>;
> Dexuan Cui <[email protected]>; Alessandro Pilotti
> <[email protected]>
> Subject: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus
>
> Fixed pep8/flake8 python style code for lsvmbus tool.
>
> The TAB indentation was on purpose ignored (pep8 rule W191) to make
> sure the code is complying with the Linux code guideline.
> The following command do not show any warnings now:
> pep8 --ignore=W191 lsvmbus
> flake8 --ignore=W191 lsvmbus
>
> Signed-off-by: Adrian Vladu <[email protected]>
>
> Cc: "K. Y. Srinivasan" <[email protected]>
> Cc: Haiyang Zhang <[email protected]>
> Cc: Stephen Hemminger <[email protected]>
> Cc: Sasha Levin <[email protected]>
> Cc: Dexuan Cui <[email protected]>
> Cc: Alessandro Pilotti <[email protected]>
> ---
> tools/hv/lsvmbus | 75 +++++++++++++++++++++++++++---------------------
> 1 file changed, 42 insertions(+), 33 deletions(-)
>
> diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
> index 55e7374bade0..099f2c44dbed 100644
> --- a/tools/hv/lsvmbus
> +++ b/tools/hv/lsvmbus
> @@ -4,10 +4,10 @@
> import os
> from optparse import OptionParser
>
> +help_msg = "print verbose messages. Try -vv, -vvv for more verbose
> messages"
> parser = OptionParser()
> -parser.add_option("-v", "--verbose", dest="verbose",
> - help="print verbose messages. Try -vv, -vvv for \
> - more verbose messages", action="count")
> +parser.add_option(
> + "-v", "--verbose", dest="verbose", help=help_msg, action="count")
>
> (options, args) = parser.parse_args()
>
> @@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path):
> exit(-1)
>
> vmbus_dev_dict = {
> - '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system
> shutdown]',
> - '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',
> - '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',
> - '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',
> - '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume
> checkpoint)]',
> - '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',
> - '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',
> - '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',
> - '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',
> - '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer
> adapter',
> - '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',
> - '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',
> - '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',
> - '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel
> adapter',
> - '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',
> - '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',
> - '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',
> - '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',
> - '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',
> + '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system
> shutdown]',
> + '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
> + '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
> + '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
> + '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume
> checkpoint)]',
> + '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
> + '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
> + '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
> + '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
> + '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer
> adapter',
> + '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
> + '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
> + '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
> + '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel
> adapter',
> + '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
> + '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
> + '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
> + '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
> + '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
> }
>
> +
> def get_vmbus_dev_attr(dev_name, attr):
> try:
> f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
> @@ -52,6 +53,7 @@ def get_vmbus_dev_attr(dev_name, attr):
>
> return lines
>
> +
> class VMBus_Dev:
> pass
>
> @@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path):
>
> chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
> chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
> - chn_vp_mapping = sorted(chn_vp_mapping,
> - key = lambda c : int(c.split(':')[0]))
> + chn_vp_mapping = sorted(
> + chn_vp_mapping, key=lambda c: int(c.split(':')[0]))
>
> - chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %
> - (c.split(':')[0], c.split(':')[1])
> - for c in chn_vp_mapping]
> + chn_vp_mapping = [
> + '\tRel_ID=%s, target_cpu=%s' %
> + (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
> + ]
> d = VMBus_Dev()
> d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
> d.vmbus_id = vmbus_id
> @@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path):
> vmbus_dev_list.append(d)
>
>
> -vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))
> +vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))
>
> format0 = '%2s: %s'
> format1 = '%2s: Class_ID = %s - %s\n%s'
> @@ -95,9 +98,15 @@ for d in vmbus_dev_list:
> if verbose == 0:
> print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
> elif verbose == 1:
> - print (('VMBUS ID ' + format1) % \
> - (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))
> + print(
> + ('VMBUS ID ' + format1) %
> + (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
> + )
> else:
> - print (('VMBUS ID ' + format2) % \
> - (d.vmbus_id, d.class_id, d.dev_desc, \
> - d.device_id, d.sysfs_path, d.chn_vp_mapping))
> + print(
> + ('VMBUS ID ' + format2) %
> + (
> + d.vmbus_id, d.class_id, d.dev_desc,
> + d.device_id, d.sysfs_path, d.chn_vp_mapping
> + )
> + )
> --
> 2.19.1

Looks good to me. Thanks, Adrian!

Reviewed-by: Dexuan Cui <[email protected]>

2019-05-09 01:12:01

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

On Tue, May 07, 2019 at 05:02:47AM +0000, Dexuan Cui wrote:
>> From: Adrian Vladu <[email protected]>
>> Sent: Monday, May 6, 2019 10:34 AM
>> To: [email protected]
>> Cc: Adrian Vladu <[email protected]>; KY Srinivasan
>> <[email protected]>; Haiyang Zhang <[email protected]>; Stephen
>> Hemminger <[email protected]>; Sasha Levin <[email protected]>;
>> Dexuan Cui <[email protected]>; Alessandro Pilotti
>> <[email protected]>
>> Subject: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus
>>
>> Fixed pep8/flake8 python style code for lsvmbus tool.
>>
>> The TAB indentation was on purpose ignored (pep8 rule W191) to make
>> sure the code is complying with the Linux code guideline.
>> The following command do not show any warnings now:
>> pep8 --ignore=W191 lsvmbus
>> flake8 --ignore=W191 lsvmbus
>>
>> Signed-off-by: Adrian Vladu <[email protected]>
>>
>> Cc: "K. Y. Srinivasan" <[email protected]>
>> Cc: Haiyang Zhang <[email protected]>
>> Cc: Stephen Hemminger <[email protected]>
>> Cc: Sasha Levin <[email protected]>
>> Cc: Dexuan Cui <[email protected]>
>> Cc: Alessandro Pilotti <[email protected]>
[...]
>Looks good to me. Thanks, Adrian!
>
>Reviewed-by: Dexuan Cui <[email protected]>

Queued for hyperv-fixes, thanks!

--
Thanks,
Sasha

2019-07-30 16:38:48

by Adrian Vladu

[permalink] [raw]
Subject: RE: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

Hello,

There were two patches you have queued for hyperv-fixes a while ago, but I don't see them anymore in the hyperv-fixes tree:
https://lore.kernel.org/patchwork/patch/1070848/
https://lore.kernel.org/patchwork/patch/1070806/

I have checked them and they can still be applied successfully on the latest master tree.
Please let me know if I need to make some amends to get them merged.

Much appreciated,
Adrian Vladu

> -----Original Message-----
> From: Sasha Levin <[email protected]>
> Sent: Thursday, May 9, 2019 4:10 AM
> To: Dexuan Cui <[email protected]>
> Cc: Adrian Vladu <[email protected]>; linux-
> [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang
> <[email protected]>; Stephen Hemminger <[email protected]>;
> Alessandro Pilotti <[email protected]>
> Subject: Re: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for
> lsvmbus
>
> On Tue, May 07, 2019 at 05:02:47AM +0000, Dexuan Cui wrote:
> >> From: Adrian Vladu <[email protected]>
> >> Sent: Monday, May 6, 2019 10:34 AM
> >> To: [email protected]
> >> Cc: Adrian Vladu <[email protected]>; KY Srinivasan
> >> <[email protected]>; Haiyang Zhang <[email protected]>; Stephen
> >> Hemminger <[email protected]>; Sasha Levin <[email protected]>;
> >> Dexuan Cui <[email protected]>; Alessandro Pilotti
> >> <[email protected]>
> >> Subject: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus
> >>
> >> Fixed pep8/flake8 python style code for lsvmbus tool.
> >>
> >> The TAB indentation was on purpose ignored (pep8 rule W191) to make
> >> sure the code is complying with the Linux code guideline.
> >> The following command do not show any warnings now:
> >> pep8 --ignore=W191 lsvmbus
> >> flake8 --ignore=W191 lsvmbus
> >>
> >> Signed-off-by: Adrian Vladu <[email protected]>
> >>
> >> Cc: "K. Y. Srinivasan" <[email protected]>
> >> Cc: Haiyang Zhang <[email protected]>
> >> Cc: Stephen Hemminger <[email protected]>
> >> Cc: Sasha Levin <[email protected]>
> >> Cc: Dexuan Cui <[email protected]>
> >> Cc: Alessandro Pilotti <[email protected]>
> [...]
> >Looks good to me. Thanks, Adrian!
> >
> >Reviewed-by: Dexuan Cui <[email protected]>
>
> Queued for hyperv-fixes, thanks!
>
> --
> Thanks,
> Sasha

2019-07-31 00:18:24

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

On Tue, Jul 30, 2019 at 02:53:35PM +0000, Adrian Vladu wrote:
>Hello,
>
>There were two patches you have queued for hyperv-fixes a while ago, but I don't see them anymore in the hyperv-fixes tree:
>https://lore.kernel.org/patchwork/patch/1070848/
>https://lore.kernel.org/patchwork/patch/1070806/
>
>I have checked them and they can still be applied successfully on the latest master tree.
>Please let me know if I need to make some amends to get them merged.

They must have got lost when we dealt with the clocksource mess. I'll
re-queue these, thanks!

--
Thanks,
Sasha

2019-07-31 08:54:16

by Adrian Vladu

[permalink] [raw]
Subject: RE: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for lsvmbus

Great, thank you!

> -----Original Message-----
> From: Sasha Levin <[email protected]>
> Sent: Wednesday, July 31, 2019 1:25 AM
> To: Adrian Vladu <[email protected]>
> Cc: Dexuan Cui <[email protected]>; [email protected]; KY
> Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>;
> Stephen Hemminger <[email protected]>; Alessandro Pilotti
> <[email protected]>
> Subject: Re: [PATCH v2] hv: tools: fixed Python pep8/flake8 warnings for
> lsvmbus
>
> On Tue, Jul 30, 2019 at 02:53:35PM +0000, Adrian Vladu wrote:
> >Hello,
> >
> >There were two patches you have queued for hyperv-fixes a while ago, but I
> don't see them anymore in the hyperv-fixes tree:
> >https://lore.kernel.org/patchwork/patch/1070848/
> >https://lore.kernel.org/patchwork/patch/1070806/
> >
> >I have checked them and they can still be applied successfully on the latest
> master tree.
> >Please let me know if I need to make some amends to get them merged.
>
> They must have got lost when we dealt with the clocksource mess. I'll
> re-queue these, thanks!
>
> --
> Thanks,
> Sasha