Skip to content

Commit 54a7800

Browse files
authored
Merge pull request #4 from brad-lewis/DLPX-61911
Remove "Loading connstat kernel module" line for parsable output
2 parents 6dd9c85 + e559f84 commit 54a7800

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

usr/cmd/connstat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ output_fields = [Field.laddr, Field.lport, Field.raddr,
8686
def lazy_load_module():
8787
lsmod=os.system("lsmod | grep connstat > /dev/null")
8888
if lsmod != 0:
89-
print("Loading connstat kernel module")
89+
if not args.parsable:
90+
print("Loading connstat kernel module")
9091
os.system("sudo depmod;sudo modprobe connstat");
9192

9293
def filter_skip(line_str_list):
@@ -144,8 +145,6 @@ def connstat_regurgitate():
144145
print (format % (line_str_list[f.index]), end="")
145146
print()
146147

147-
lazy_load_module()
148-
149148
parser = argparse.ArgumentParser(prog='connstat')
150149

151150
parser.add_argument('-c', '--count', action=ParsePositiveIntegerAction,
@@ -215,6 +214,7 @@ while True:
215214
print ("=", end =" ")
216215
os.system("date")
217216

217+
lazy_load_module()
218218
connstat_regurgitate()
219219

220220
if args.SECONDS is None:

0 commit comments

Comments
 (0)