From 7d8434c702d3e5f3d18f8c08a58e88f38c4cf12a Mon Sep 17 00:00:00 2001 From: Ashwinh Date: Wed, 26 Jun 2024 15:16:08 +0000 Subject: [PATCH 1/2] CP-49903: Moved echo.py from scripts/examples/python to python3/plugins directory Signed-off-by: Ashwinh --- python3/Makefile | 1 + {scripts/examples/python => python3/plugins}/echo.py | 4 ++-- scripts/Makefile | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) rename {scripts/examples/python => python3/plugins}/echo.py (75%) diff --git a/python3/Makefile b/python3/Makefile index 4117ad4fc35..8f34cb8e107 100644 --- a/python3/Makefile +++ b/python3/Makefile @@ -28,6 +28,7 @@ install: $(IPROG) bin/xe-scsi-dev-map $(DESTDIR)$(OPTDIR)/bin $(IPROG) plugins/disk-space $(DESTDIR)$(PLUGINDIR) $(IPROG) plugins/install-supp-pack $(DESTDIR)$(PLUGINDIR) + $(IPROG) plugins/echo.py $(DESTDIR)$(PLUGINDIR)/echo # poweron $(IPROG) poweron/wlan.py $(DESTDIR)$(PLUGINDIR)/wlan.py diff --git a/scripts/examples/python/echo.py b/python3/plugins/echo.py similarity index 75% rename from scripts/examples/python/echo.py rename to python3/plugins/echo.py index 57f70492c6c..482bc19e5e2 100644 --- a/scripts/examples/python/echo.py +++ b/python3/plugins/echo.py @@ -5,8 +5,8 @@ import XenAPIPlugin - -def main(session, args): +#First argument passed in session which is not used ,using _ to ignore +def main(_, args): if "sleep" in args: secs = int(args["sleep"]) time.sleep(secs) diff --git a/scripts/Makefile b/scripts/Makefile index 434d0819de1..705b161158a 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -161,7 +161,6 @@ endif sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/python3/' $(DESTDIR)$(SITE3_DIR)/XenAPIPlugin.py $(IDATA) examples/python/XenAPI/XenAPI.py $(DESTDIR)$(SITE3_DIR)/ $(IDATA) examples/python/inventory.py $(DESTDIR)$(SITE3_DIR)/ - $(IPROG) examples/python/echo.py $(DESTDIR)$(PLUGINDIR)/echo $(IPROG) examples/python/shell.py $(DESTDIR)$(LIBEXECDIR)/shell.py # YUM plugins $(IPROG) yum-plugins/accesstoken.py $(DESTDIR)$(YUMPLUGINDIR) From deaca4be486f3a254f1ccf5f8245783a42a791fc Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Thu, 27 Jun 2024 00:37:26 +0200 Subject: [PATCH 2/2] python3/plugins/echo.py: Fix spelling of the added comment Signed-off-by: Bernhard Kaindl --- python3/plugins/echo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3/plugins/echo.py b/python3/plugins/echo.py index 482bc19e5e2..27020e17065 100644 --- a/python3/plugins/echo.py +++ b/python3/plugins/echo.py @@ -5,7 +5,7 @@ import XenAPIPlugin -#First argument passed in session which is not used ,using _ to ignore +# The 1st argument is the session. This plugin does not use it, hence use _: def main(_, args): if "sleep" in args: secs = int(args["sleep"])