[PATCH net-next v2 02/14] tools: ynl: move the cli and netlink code around

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move the CLI code out of samples/ and the library part
of it into tools/net/ynl/lib/. This way we can start
sharing some code with the code gen.

Initially I thought that code gen is too C-specific to
share anything but basic stuff like calculating values
for enums can easily be shared.

Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
---
 tools/net/ynl/{samples => }/cli.py    | 2 +-
 tools/net/ynl/lib/__init__.py         | 5 +++++
 tools/net/ynl/{samples => lib}/ynl.py | 0
 3 files changed, 6 insertions(+), 1 deletion(-)
 rename tools/net/ynl/{samples => }/cli.py (97%)
 create mode 100644 tools/net/ynl/lib/__init__.py
 rename tools/net/ynl/{samples => lib}/ynl.py (100%)

diff --git a/tools/net/ynl/samples/cli.py b/tools/net/ynl/cli.py
similarity index 97%
rename from tools/net/ynl/samples/cli.py
rename to tools/net/ynl/cli.py
index b27159c70710..5c4eb5a68514 100755
--- a/tools/net/ynl/samples/cli.py
+++ b/tools/net/ynl/cli.py
@@ -6,7 +6,7 @@ import json
 import pprint
 import time
 
-from ynl import YnlFamily
+from lib import YnlFamily
 
 
 def main():
diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/lib/__init__.py
new file mode 100644
index 000000000000..0a6102758ebe
--- /dev/null
+++ b/tools/net/ynl/lib/__init__.py
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+
+from .ynl import YnlFamily
+
+__all__ = ["YnlFamily"]
diff --git a/tools/net/ynl/samples/ynl.py b/tools/net/ynl/lib/ynl.py
similarity index 100%
rename from tools/net/ynl/samples/ynl.py
rename to tools/net/ynl/lib/ynl.py
-- 
2.39.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux