From 9156905437b53b429d6ee8d2cbf45d44592918b8 Mon Sep 17 00:00:00 2001 From: pceicicd Date: Sat, 11 Nov 2023 18:21:34 -0800 Subject: [PATCH] delete the file that attaches to a copyleft license Change-Id: Ibf5a8f50daf6ceb5d56e886787a2a7f30aa78151 Signed-off-by: pceicicd --- XTesting/powder-control/README.md | 4 ++ XTesting/powder-control/powder/rpc.py | 124 ---------------------------------- 2 files changed, 4 insertions(+), 124 deletions(-) delete mode 100644 XTesting/powder-control/powder/rpc.py diff --git a/XTesting/powder-control/README.md b/XTesting/powder-control/README.md index 4baa006..bdba8fe 100644 --- a/XTesting/powder-control/README.md +++ b/XTesting/powder-control/README.md @@ -22,6 +22,10 @@ so in the drop-down menu accessed by clicking on your username after logging into the Powder portal. This will download a file called `cloudlab.pem`, which you will need later. +Due to a copyleft license issue, it needs to pull code directly from the repo +https://gitlab.flux.utah.edu/powder-profiles/powder-control and add the powder/rpc.py +to the XTesting/powder-control/powder directory from the it/test repo. + You will need to make sure the machine you are using has `python3` installed, as well as the packages in [requirements.txt](requirements.txt). You can install the packages by doing diff --git a/XTesting/powder-control/powder/rpc.py b/XTesting/powder-control/powder/rpc.py deleted file mode 100644 index 5520b7e..0000000 --- a/XTesting/powder-control/powder/rpc.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2004-2020 University of Utah and the Flux Group. -# -# {{{EMULAB-LICENSE -# -# This file is part of the Emulab network testbed software. -# -# This file is free software: you can redistribute it and/or modify it -# under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or (at -# your option) any later version. -# -# This file is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public -# License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this file. If not, see . -# -# }}} -# - -import logging -import os -import ssl -import sys -import xmlrpc.client as xmlrpc_client - - -PACKAGE_VERSION = 0.1 -DEBUG = 0 - -# rpc server -XMLRPC_SERVER = "boss.emulab.net" -XMLRPC_PORT = 3069 -SERVER_PATH = "/usr/testbed" -URI = "https://" + XMLRPC_SERVER + ":" + str(XMLRPC_PORT) + SERVER_PATH - -RESPONSE_SUCCESS = 0 -RESPONSE_BADARGS = 1 -RESPONSE_ERROR = 2 -RESPONSE_FORBIDDEN = 3 -RESPONSE_BADVERSION = 4 -RESPONSE_SERVERERROR = 5 -RESPONSE_TOOBIG = 6 -RESPONSE_REFUSED = 7 # Emulab is down, try again later. -RESPONSE_TIMEDOUT = 8 - -# User supplied login ID, password, and certificate -try: - LOGIN_ID = os.environ['USER'] - PEM_PWORD = os.environ['PWORD'] - CERT_PATH = os.environ['CERT'] -except KeyError: - logging.error('Missing Powder credential environment variable(s)') - sys.exit(1) - - -def do_method(method, params): - ctx = ssl.SSLContext() - ctx.set_ciphers('ALL:@SECLEVEL=0') - ctx.load_cert_chain(CERT_PATH, password=PEM_PWORD) - ctx.check_hostname = False - ctx.verify_mode = ssl.CERT_NONE - - # Get a handle on the server, - server = xmlrpc_client.ServerProxy(URI, context=ctx, verbose=DEBUG) - - # Get a pointer to the function we want to invoke. - meth = getattr(server, "portal." + method) - meth_args = [PACKAGE_VERSION, params] - - # Make the call. - try: - response = meth(*meth_args) - except xmlrpc_client.Fault as e: - print(e.faultString) - return -1, None - - rval = response["code"] - - # If the code indicates failure, look for a "value". Use that as the - # return value instead of the code. - if rval != RESPONSE_SUCCESS: - if response["value"]: - rval = response["value"] - - return rval, response - - -def start_experiment(experiment_name, project_name, profile_name): - params = { - "name": experiment_name, - "proj": project_name, - "profile": ','.join([project_name, profile_name]) - } - rval, response = do_method("startExperiment", params) - return rval, response - - -def terminate_experiment(project_name, experiment_name): - params = { - "experiment": ','.join([project_name, experiment_name]) - } - rval, response = do_method("terminateExperiment", params) - return rval, response - - -def get_experiment_status(project_name, experiment_name): - params = { - "experiment": ','.join([project_name, experiment_name]) - } - rval, response = do_method("experimentStatus", params) - return rval, response - - -def get_experiment_manifests(project_name, experiment_name): - params = { - "experiment": ','.join([project_name, experiment_name]) - } - rval, response = do_method("experimentManifests", params) - return rval, response -- 2.16.6