summaryrefslogtreecommitdiffstats
path: root/utils/mk-discovery-conf.py
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@debian.org>2023-06-10 08:55:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-10 09:21:49 +0000
commit88837172f69eabc408ae3945d82e0270b8e07440 (patch)
treed6b7fa06694f45d25f54f6ea9ded93c981e51f6f /utils/mk-discovery-conf.py
parentInitial commit. (diff)
downloadnvme-stas-88837172f69eabc408ae3945d82e0270b8e07440.tar.xz
nvme-stas-88837172f69eabc408ae3945d82e0270b8e07440.zip
Adding upstream version 2.2.1.upstream/2.2.1
Signed-off-by: Benjamin Drung <bdrung@debian.org>
Diffstat (limited to 'utils/mk-discovery-conf.py')
-rwxr-xr-xutils/mk-discovery-conf.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/mk-discovery-conf.py b/utils/mk-discovery-conf.py
new file mode 100755
index 0000000..a13c48e
--- /dev/null
+++ b/utils/mk-discovery-conf.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+# USAGE: stafctl ls | ./mk-discovery-conf.py
+
+import sys
+
+KEYS = [
+ ('transport', None),
+ ('traddr', None),
+ ('subsysnqn', 'nqn'),
+ ('host-iface', None),
+ ('host-traddr', None),
+]
+
+for ctrl in eval(sys.stdin.read()):
+ print(f"{' '.join([f'--{kout or kin}={ctrl[kin]}' for kin,kout in KEYS if ctrl[kin] != ''])}")