From 1c5599bd61e2fe0b71552d4da497ba13fb12696a Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Fri, 7 Jul 2023 15:23:22 +0300 Subject: [PATCH] got rid of any code that references maintenance.loadconfiguration(fabric), this include the maintenance.check_version command which that load_configuration was meant to be used by --- modules/initialize.py | 3 -- modules/maintenance.py | 64 +----------------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/modules/initialize.py b/modules/initialize.py index 6ac02dc..ef87560 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -217,9 +217,6 @@ def get_config(branchname): config = maintenance.load_configuration("config", branchname) layout = maintenance.load_configuration("layout", branchname) - # fabric_config = maintenance.load_configuration("fabric", branchname) - # maintenance.check_version(branchname) - dataobject = DataObject(dict()) dataobject.addbranch('project') diff --git a/modules/maintenance.py b/modules/maintenance.py index 4cc655d..6eb300f 100644 --- a/modules/maintenance.py +++ b/modules/maintenance.py @@ -3,7 +3,6 @@ from fabric.api import local import os import sys -from . import utils from .utils import executize, virtualenv, loggify @@ -228,11 +227,7 @@ def load_configuration(name, branch): # # the locations of the files we need relative to the PROJECT_ROOT - if name == "fabric": - file_path = os.path.join( - get_project_root(), 'scripts', 'fabric', 'share', 'fabric.yml') - - elif name == "config": + if name == "config": # # the configuration we are working with will change @@ -247,60 +242,3 @@ def load_configuration(name, branch): configuration_file = yaml.load( open(file_path, 'r'), Loader=yaml.FullLoader) return configuration_file - - -@task -def check_version(branchname): - """ - Maintenance function to check the configuration version against - the fabric version currently loaded. Returns boolean - - If the version is either non-existant or not the same as the fabric - configuration version, then a message will be sent to the user letting - him know, and giving him the option to stop the program. If he chooses - to continue, the function will return "False" to the calling function - - Otherwise, everything will continue as normal and "True" will be returned - - Keyword Arguments: - - branchname -- the name of the branch whose configuration files we are - checking - """ - - config = load_configuration("config", branchname) - fabric_config = load_configuration("fabric", branchname) - - if 'version' in config: - config_version = config['version'] - else: - config_version = 0 - - version_correct = config_version >= fabric_config['version'] - - utils.printvar('version_correct', version_correct) - - if not version_correct: - - # TODO - # update this message, currently it is false because there is no - # fabric.updateconfs function! - - version_false = """ - NOTE: the current configuration information related to this project - is not up to date, the fabric tools are at version %s, and you are - at version %s. Run fab fabric.updateconfs to correct.\n""" - - utils.print_console( - version_false % (fabric_config['version'], config_version), - numsep=90) - - # utils.prompt_continue() - - # version was not correct return False to let the app - # know what's going on - return False - - # version was correct, so return True to let the app know - # everything is A-OK - return True