From 889b1bf9a5a1bfd76f0f8d12b4de8315e3953338 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 12 Jul 2024 12:00:00 +0200 Subject: [PATCH] rm ocaml/idl/ocaml_backend/python: remove obsolete example scripts These example scripts were imported in 2009 and are obsoleted by samples like: https://github.com/xapi-project/xen-api-sdk/blob/master/python/samples/powercycle.py - The sample xen-api-sdk/python/samples/powercycle.py is much better. - They are not installed and not otherwise mentioned in the repository. Signed-off-by: Bernhard Kaindl --- ocaml/idl/ocaml_backend/python/list_vms.py | 10 ----- ocaml/idl/ocaml_backend/python/pause_vm.py | 6 --- ocaml/idl/ocaml_backend/python/test_client.py | 44 ------------------- ocaml/idl/ocaml_backend/python/unpause_vm.py | 6 --- pyproject.toml | 2 - 5 files changed, 68 deletions(-) delete mode 100755 ocaml/idl/ocaml_backend/python/list_vms.py delete mode 100755 ocaml/idl/ocaml_backend/python/pause_vm.py delete mode 100755 ocaml/idl/ocaml_backend/python/test_client.py delete mode 100755 ocaml/idl/ocaml_backend/python/unpause_vm.py diff --git a/ocaml/idl/ocaml_backend/python/list_vms.py b/ocaml/idl/ocaml_backend/python/list_vms.py deleted file mode 100755 index 0d7a75313cb..00000000000 --- a/ocaml/idl/ocaml_backend/python/list_vms.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/python - -import xmlrpclib -server = xmlrpclib.Server("http://melton:8086"); -session = server.session.login_with_password("root", "xenroot", "1.0", "xen-api-list-vms.py")['Value'] -print session -vms = server.VM.get_all(session)['Value'] -print vms -#for vm in vms: -# print vm,server.VM.get_kernel__kernel(session, vm) diff --git a/ocaml/idl/ocaml_backend/python/pause_vm.py b/ocaml/idl/ocaml_backend/python/pause_vm.py deleted file mode 100755 index 2795496e1cd..00000000000 --- a/ocaml/idl/ocaml_backend/python/pause_vm.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -import xmlrpclib -server = xmlrpclib.Server("http://localhost:8086"); -session = server.Session.do_login_with_password("user", "passwd", "1.0", "xen-api-pause-vm.py")['Value'] -server.VM.do_pause(session, '7366a41a-e50e-b891-fa0c-ca5b4d2e3f1c') diff --git a/ocaml/idl/ocaml_backend/python/test_client.py b/ocaml/idl/ocaml_backend/python/test_client.py deleted file mode 100755 index 05888c97db7..00000000000 --- a/ocaml/idl/ocaml_backend/python/test_client.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python - -import getopt, sys, xmlrpclib - -url = "http://dhcp108:70000" #default -parsed = getopt.getopt(sys.argv[1:], "u:url") -if len(parsed[0]) == 1: - url = parsed[0][0][1] - -# Create an object to represent our server. -server = xmlrpclib.Server(url); - -# Call the server and get our result. -print "Logging in... ", -session = server.Session.do_login_with_password("user", "passwd", "1.0", "xen-api-test-client.py") -print "OK" -print "Session ID: \""+session+"\"" -vm_list = server.VM.do_list(session) - -print "VM list = " + repr(vm_list) - -for vm in vm_list: - print "VM ", vm, " in state: ", server.VM.get_power_state(session, vm) - -first_vm = vm_list[0] -other = server.VM.get_otherConfig(session, first_vm) -print repr(other) - - -#state = server.VM.get_power_state(session, first_vm) -#if state == "Halted": -# print "Starting first VM... ", -# server.VM.do_start(session, first_vm, 1==0) -#elif state == "Suspended": -# print "Restoring first VM..." -# server.VM.do_unhibernate(session, first_vm, 1==0) -#elif state == "Running": -# print "Suspending first VM... ", -# server.VM.do_hibernate(session, first_vm, 1==1) -#print "OK" - -print "Logging out... ", -server.Session.do_logout(session) -print "OK" diff --git a/ocaml/idl/ocaml_backend/python/unpause_vm.py b/ocaml/idl/ocaml_backend/python/unpause_vm.py deleted file mode 100755 index 97d748e1dca..00000000000 --- a/ocaml/idl/ocaml_backend/python/unpause_vm.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -import xmlrpclib -server = xmlrpclib.Server("http://localhost:8086"); -session = server.Session.do_login_with_password("user", "passwd", "1.0", "xen-api-unpause-vm.py")['Value'] -server.VM.do_unpause(session, '7366a41a-e50e-b891-fa0c-ca5b4d2e3f1c') diff --git a/pyproject.toml b/pyproject.toml index 2749d69956f..555f1940203 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -287,8 +287,6 @@ inputs = [ # To be added later, # when converted to Python3-compatible syntax: - # "ocaml/message-switch/python", - # "ocaml/idl/ocaml_backend/python", # "ocaml/xapi-storage/python", ] disable = [