diff --git a/bench/app.py b/bench/app.py index 0710d65b..443156f3 100755 --- a/bench/app.py +++ b/bench/app.py @@ -215,7 +215,7 @@ def is_version_upgrade(app='frappe', bench_path='.', branch=None): local_version = get_major_version(get_current_version(app, bench_path=bench_path)) upstream_version = get_major_version(upstream_version) - + if upstream_version - local_version > 0: return (True, local_version, upstream_version) diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index bcc76d6b..303e8149 100755 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -95,19 +95,22 @@ def migrate_env(python, no_backup = False): """ Migrate Virtual Environment to desired Python Version. """ - # Clear Cache before Bench Dies. - config = get_config(bench_path = os.getcwd()) - rredis = urlparse(config['redis_cache']) + try: + # Clear Cache before Bench Dies. + config = get_config(bench_path = os.getcwd()) + rredis = urlparse(config['redis_cache']) - redis = '{redis} -p {port}'.format( - redis = which('redis-cli'), - port = rredis.port - ) + redis = '{redis} -p {port}'.format( + redis = which('redis-cli'), + port = rredis.port + ) - log.debug('Clearing Redis Cache...') - exec_cmd('{redis} FLUSHALL'.format(redis = redis)) - log.debug('Clearing Redis DataBase...') - exec_cmd('{redis} FLUSHDB'.format(redis = redis)) + log.debug('Clearing Redis Cache...') + exec_cmd('{redis} FLUSHALL'.format(redis = redis)) + log.debug('Clearing Redis DataBase...') + exec_cmd('{redis} FLUSHDB'.format(redis = redis)) + except Exception: + log.warn('Please ensure Redis Connections are running or Daemonized.') try: # This is with the assumption that a bench is set-up within path.