From a70273dbae96886079a37b1d9acbdca50b2a2440 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 16 Aug 2023 23:54:51 -0400 Subject: [PATCH] Move old CLI client out of the way --- client-cli-old/pvc.py | 33 +++++++++++++++++++ .../pvc/__init__.py | 0 .../pvc/lib/__init__.py | 0 .../pvc/lib/ansiprint.py | 0 .../pvc/lib/ceph.py | 4 +-- .../pvc/lib/cluster.py | 4 +-- .../pvc/lib/common.py | 0 .../pvc/lib/network.py | 4 +-- .../pvc/lib/node.py | 4 +-- .../pvc/lib/provisioner.py | 4 +-- {client-cli => client-cli-old}/pvc/lib/vm.py | 8 ++--- .../pvc/lib/zkhandler.py | 0 {client-cli => client-cli-old}/pvc/pvc.py | 0 {client-cli => client-cli-old}/scripts/README | 0 .../scripts/export_vm | 0 .../scripts/force_single_node | 0 .../scripts/import_vm | 0 .../scripts/migrate_vm | 0 {client-cli => client-cli-old}/setup.py | 0 19 files changed, 47 insertions(+), 14 deletions(-) create mode 100755 client-cli-old/pvc.py rename {client-cli => client-cli-old}/pvc/__init__.py (100%) rename {client-cli => client-cli-old}/pvc/lib/__init__.py (100%) rename {client-cli => client-cli-old}/pvc/lib/ansiprint.py (100%) rename {client-cli => client-cli-old}/pvc/lib/ceph.py (99%) rename {client-cli => client-cli-old}/pvc/lib/cluster.py (99%) rename {client-cli => client-cli-old}/pvc/lib/common.py (100%) rename {client-cli => client-cli-old}/pvc/lib/network.py (99%) rename {client-cli => client-cli-old}/pvc/lib/node.py (99%) rename {client-cli => client-cli-old}/pvc/lib/provisioner.py (99%) rename {client-cli => client-cli-old}/pvc/lib/vm.py (99%) rename {client-cli => client-cli-old}/pvc/lib/zkhandler.py (100%) rename {client-cli => client-cli-old}/pvc/pvc.py (100%) rename {client-cli => client-cli-old}/scripts/README (100%) rename {client-cli => client-cli-old}/scripts/export_vm (100%) rename {client-cli => client-cli-old}/scripts/force_single_node (100%) rename {client-cli => client-cli-old}/scripts/import_vm (100%) rename {client-cli => client-cli-old}/scripts/migrate_vm (100%) rename {client-cli => client-cli-old}/setup.py (100%) diff --git a/client-cli-old/pvc.py b/client-cli-old/pvc.py new file mode 100755 index 00000000..6102ddcf --- /dev/null +++ b/client-cli-old/pvc.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +# pvc.py - PVC client command-line interface (stub testing interface) +# Part of the Parallel Virtual Cluster (PVC) system +# +# Copyright (C) 2018-2022 Joshua M. Boniface +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################### + +import pvc.pvc + + +# +# Main entry point +# +def main(): + return pvc.pvc.cli(obj={}) + + +if __name__ == "__main__": + main() diff --git a/client-cli/pvc/__init__.py b/client-cli-old/pvc/__init__.py similarity index 100% rename from client-cli/pvc/__init__.py rename to client-cli-old/pvc/__init__.py diff --git a/client-cli/pvc/lib/__init__.py b/client-cli-old/pvc/lib/__init__.py similarity index 100% rename from client-cli/pvc/lib/__init__.py rename to client-cli-old/pvc/lib/__init__.py diff --git a/client-cli/pvc/lib/ansiprint.py b/client-cli-old/pvc/lib/ansiprint.py similarity index 100% rename from client-cli/pvc/lib/ansiprint.py rename to client-cli-old/pvc/lib/ansiprint.py diff --git a/client-cli/pvc/lib/ceph.py b/client-cli-old/pvc/lib/ceph.py similarity index 99% rename from client-cli/pvc/lib/ceph.py rename to client-cli-old/pvc/lib/ceph.py index 8bae9d3c..7738f3f2 100644 --- a/client-cli/pvc/lib/ceph.py +++ b/client-cli-old/pvc/lib/ceph.py @@ -27,8 +27,8 @@ from requests_toolbelt.multipart.encoder import ( MultipartEncoderMonitor, ) -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import UploadProgressBar, call_api +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import UploadProgressBar, call_api # # Supplemental functions diff --git a/client-cli/pvc/lib/cluster.py b/client-cli-old/pvc/lib/cluster.py similarity index 99% rename from client-cli/pvc/lib/cluster.py rename to client-cli-old/pvc/lib/cluster.py index eb88ea87..c93fdb2d 100644 --- a/client-cli/pvc/lib/cluster.py +++ b/client-cli-old/pvc/lib/cluster.py @@ -21,8 +21,8 @@ import json -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import call_api +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import call_api def initialize(config, overwrite=False): diff --git a/client-cli/pvc/lib/common.py b/client-cli-old/pvc/lib/common.py similarity index 100% rename from client-cli/pvc/lib/common.py rename to client-cli-old/pvc/lib/common.py diff --git a/client-cli/pvc/lib/network.py b/client-cli-old/pvc/lib/network.py similarity index 99% rename from client-cli/pvc/lib/network.py rename to client-cli-old/pvc/lib/network.py index e148582b..8b07960f 100644 --- a/client-cli/pvc/lib/network.py +++ b/client-cli-old/pvc/lib/network.py @@ -20,8 +20,8 @@ ############################################################################### import re -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import call_api +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import call_api def isValidMAC(macaddr): diff --git a/client-cli/pvc/lib/node.py b/client-cli-old/pvc/lib/node.py similarity index 99% rename from client-cli/pvc/lib/node.py rename to client-cli-old/pvc/lib/node.py index 1755b96a..2390319a 100644 --- a/client-cli/pvc/lib/node.py +++ b/client-cli-old/pvc/lib/node.py @@ -21,8 +21,8 @@ import time -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import call_api +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import call_api # diff --git a/client-cli/pvc/lib/provisioner.py b/client-cli-old/pvc/lib/provisioner.py similarity index 99% rename from client-cli/pvc/lib/provisioner.py rename to client-cli-old/pvc/lib/provisioner.py index 26b9cede..f533621d 100644 --- a/client-cli/pvc/lib/provisioner.py +++ b/client-cli-old/pvc/lib/provisioner.py @@ -24,8 +24,8 @@ from requests_toolbelt.multipart.encoder import ( MultipartEncoderMonitor, ) -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import UploadProgressBar, call_api +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import UploadProgressBar, call_api from ast import literal_eval diff --git a/client-cli/pvc/lib/vm.py b/client-cli-old/pvc/lib/vm.py similarity index 99% rename from client-cli/pvc/lib/vm.py rename to client-cli-old/pvc/lib/vm.py index 2f761e9a..65abc5c8 100644 --- a/client-cli/pvc/lib/vm.py +++ b/client-cli-old/pvc/lib/vm.py @@ -22,8 +22,8 @@ import time import re -import pvc.cli_lib.ansiprint as ansiprint -from pvc.cli_lib.common import call_api, format_bytes, format_metric +import pvc.lib.ansiprint as ansiprint +from pvc.lib.common import call_api, format_bytes, format_metric # @@ -677,7 +677,7 @@ def vm_networks_add( from lxml.objectify import fromstring from lxml.etree import tostring from random import randint - import pvc.cli_lib.network as pvc_network + import pvc.lib.network as pvc_network network_exists, _ = pvc_network.net_info(config, network) if not network_exists: @@ -1046,7 +1046,7 @@ def vm_volumes_add(config, vm, volume, disk_id, bus, disk_type, live, restart): from lxml.objectify import fromstring from lxml.etree import tostring from copy import deepcopy - import pvc.cli_lib.ceph as pvc_ceph + import pvc.lib.ceph as pvc_ceph if disk_type == "rbd": # Verify that the provided volume is valid diff --git a/client-cli/pvc/lib/zkhandler.py b/client-cli-old/pvc/lib/zkhandler.py similarity index 100% rename from client-cli/pvc/lib/zkhandler.py rename to client-cli-old/pvc/lib/zkhandler.py diff --git a/client-cli/pvc/pvc.py b/client-cli-old/pvc/pvc.py similarity index 100% rename from client-cli/pvc/pvc.py rename to client-cli-old/pvc/pvc.py diff --git a/client-cli/scripts/README b/client-cli-old/scripts/README similarity index 100% rename from client-cli/scripts/README rename to client-cli-old/scripts/README diff --git a/client-cli/scripts/export_vm b/client-cli-old/scripts/export_vm similarity index 100% rename from client-cli/scripts/export_vm rename to client-cli-old/scripts/export_vm diff --git a/client-cli/scripts/force_single_node b/client-cli-old/scripts/force_single_node similarity index 100% rename from client-cli/scripts/force_single_node rename to client-cli-old/scripts/force_single_node diff --git a/client-cli/scripts/import_vm b/client-cli-old/scripts/import_vm similarity index 100% rename from client-cli/scripts/import_vm rename to client-cli-old/scripts/import_vm diff --git a/client-cli/scripts/migrate_vm b/client-cli-old/scripts/migrate_vm similarity index 100% rename from client-cli/scripts/migrate_vm rename to client-cli-old/scripts/migrate_vm diff --git a/client-cli/setup.py b/client-cli-old/setup.py similarity index 100% rename from client-cli/setup.py rename to client-cli-old/setup.py