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
This commit is contained in:
parent
55e6c98075
commit
1c5599bd61
2 changed files with 1 additions and 66 deletions
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue