Skip to content

Commit f30e199

Browse files
python linter: clean api/examples/getvolfile.py
This series aim to reduce the python linter build logs. This commit silences most of the python linter complaints without any functional changes. The changes include mostly formatting and missing obvious docstrings. We left out dependency and exception handling complaints on purpose to be addressed separately. Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
1 parent 01003ce commit f30e199

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/examples/getvolfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/python3
2+
"""gfapi example for glfs_get_volfile()."""
23

34
from __future__ import print_function
5+
46
import ctypes
57
import ctypes.util
68

@@ -12,6 +14,7 @@
1214

1315

1416
def get_volfile(host, volume):
17+
"""Exercises glfs_get_volfile."""
1518
# This is set to a large value to exercise the "buffer not big enough"
1619
# path. More realistically, you'd just start with a huge buffer.
1720
BUF_LEN = 0
@@ -30,6 +33,7 @@ def get_volfile(host, volume):
3033
return vlen
3134
return vbuf.value[:vlen]
3235

36+
3337
if __name__ == "__main__":
3438
import sys
3539

@@ -42,4 +46,4 @@ def get_volfile(host, volume):
4246
for line in res.split('\n'):
4347
print(line)
4448
except:
45-
print("bad return value %s" % res)
49+
print(f"bad return value {res}")

0 commit comments

Comments
 (0)