import sys
import logging
from lib.command import Command
+from lib.exceptions import UpgradeNotAllowed
class UpdateCommand(Command):
if args.upgrade:
try:
M.upgrade()
+ except UpgradeNotAllowed as e:
+ logging.info('Skipping upgrade of %s (not allowed)' % (M.get('identifier')))
+ logging.debug(e)
except Exception as e:
errors.append(M)
logging.warning('Error during the upgrade of %s' % M.get('identifier'))
import sys
import logging
from lib.command import Command
-
+from lib.exceptions import UpgradeNotAllowed
class UpgradeCommand(Command):
try:
M.upgrade(args.nocheckout)
+ except UpgradeNotAllowed as e:
+ logging.info('Skipping upgrade of %s (not allowed)' % (M.get('identifier')))
+ logging.debug(e)
except Exception as e:
errors.append(M)
logging.warning('Error during the upgrade of %s' % M.get('identifier'))
class UnsupportedScript(Exception):
pass
+
+
+class UpgradeNotAllowed(Exception):
+ pass
from db import DB
from config import Conf
from git import Git, GitException
-from exceptions import InstallException
+from exceptions import InstallException, UpgradeNotAllowed
from jira import Jira
from scripts import Scripts
raise Exception('Cannot upgrade an instance which is not installed.')
elif not self.branch_compare(20):
raise Exception('Upgrade command line tool not supported by this version.')
+ elif os.path.isfile(os.path.join(self.get('path'), '.noupgrade')):
+ raise UpgradeNotAllowed('Upgrade not allowed, found .noupgrade.')
# Checkout stable
if not nocheckout: