diff --git a/src/rockstor/smart_manager/data_collector.py b/src/rockstor/smart_manager/data_collector.py index 5f4d6b58b..e8f4a4dce 100644 --- a/src/rockstor/smart_manager/data_collector.py +++ b/src/rockstor/smart_manager/data_collector.py @@ -50,7 +50,7 @@ from smart_manager.models import Service # noqa E402 from system.services import service_status # noqa E402 from cli.api_wrapper import APIWrapper # noqa E402 -from system.pkg_mgmt import (update_check, yum_check) # noqa E402 +from system.pkg_mgmt import (rockstor_pkg_update_check, pkg_update_check) # noqa E402 import distro import logging # noqa E402 logger = logging.getLogger(__name__) @@ -948,7 +948,7 @@ def update_storage_state(self): def update_check(self): - uinfo = update_check() + uinfo = rockstor_pkg_update_check() self.emit('software_update', { 'key': 'sysinfo:software_update', @@ -958,16 +958,19 @@ def update_check(self): def yum_updates(self): while self.start: - rc, packages = yum_check() + packages = pkg_update_check() data = {} - data['yum_updates'] = True if rc == 100 else False + if packages: # Non empty lists are True. + data['yum_updates'] = True + else: + data['yum_updates'] = False data['packages'] = packages self.emit('yum_updates', { 'key': 'sysinfo:yum_updates', 'data': data }) - gevent.sleep(1800) + gevent.sleep(1800) # 1800 seconds = 30 mins def on_runyum(self, sid): @@ -985,7 +988,7 @@ def launch_yum(): 'data': data }) except Exception as e: - logger.error('Unable to perform Yum Updates: %s' + logger.error('Unable to perform Package Updates: %s' % e.__str__()) self.spawn(launch_yum, sid) diff --git a/src/rockstor/storageadmin/static/storageadmin/js/router.js b/src/rockstor/storageadmin/static/storageadmin/js/router.js index ae47b0a38..5507bee95 100644 --- a/src/rockstor/storageadmin/static/storageadmin/js/router.js +++ b/src/rockstor/storageadmin/static/storageadmin/js/router.js @@ -1124,7 +1124,7 @@ $(document).ready(function() { } }; - var yum_updating = false; //global var to check if yum is updating + var yum_updating = false; //global var to check if yum/zypper are updating var displayYumUpdates = function(data) { if (typeof data.yum_updating != 'undefined' && !data.yum_updating) { console.log('closing'); @@ -1133,7 +1133,7 @@ $(document).ready(function() { } if (data.yum_updates && !yum_updating) { $('#yum-msg').fadeIn(0); - $('#yum-msg a').html(''); + $('#yum-msg a').html(''); if ($('#yum_panels').is(':empty')) { _.each(data.packages, function(pkg) { var html = ''; @@ -1162,13 +1162,13 @@ $(document).ready(function() { }; $('#yum-run').click(function(event) { - var run_update = confirm('Do you want to procede with yum updates?'); + var run_update = confirm('Do you want to proceed with these updates?'); if (run_update) { RockStorSocket.sysinfo.emit('runyum'); $('#yum_modal').modal('hide'); yum_updating = true; $('#yum_panels').empty(); - $('#yum-msg a').html(''); + $('#yum-msg a').html(''); } }); diff --git a/src/rockstor/storageadmin/templates/storageadmin/base.html b/src/rockstor/storageadmin/templates/storageadmin/base.html index 9e48c9274..cc0b9de38 100644 --- a/src/rockstor/storageadmin/templates/storageadmin/base.html +++ b/src/rockstor/storageadmin/templates/storageadmin/base.html @@ -203,7 +203,7 @@