def management_connection_reidentify(self, identify_result): # from managementconnection _log.info("management connection reidentify") if identify_result is None: _log.warning("identify result is None, connect() or start_primary() called twice? ignoring") return try: helpers.write_cookie_uuid(identify_result["cookieUuid"]) except: _log.exception("failed to write cookie UUID") try: self._license_helper.update_license_info(identify_result) except: _log.exception("license info update failed") try: self._update_update_info(identify_result) except: _log.exception("update update info failed") try: self._do_timesync(identify_result["currentUtcTime"]) except: _log.exception("timesync failed") try: self._immediate_auto_update_check(identify_result) except: _log.exception("immediate auto update check failed") self._ajax_helper.wake_status_change_waiters()
def management_connection_up(self, identify_result): # from managementconnection _log.info("management connection established") if identify_result is None: _log.warning("identify result is None, connect() or start_primary() called twice? ignoring") return try: helpers.write_cookie_uuid(identify_result["cookieUuid"]) except: _log.exception("failed to write cookie UUID") try: self._license_helper.update_license_info(identify_result) except: _log.exception("license info update failed") try: self._update_update_info(identify_result) except: _log.exception("update update info failed") try: self._do_timesync(identify_result["currentUtcTime"]) except: _log.exception("timesync failed") try: self._immediate_auto_update_check(identify_result) except: _log.exception("immediate auto update check failed") try: self._write_connection_state(identify_result) except: _log.exception("write connection state failed") # XXX: If license parameters have changed, we might ideally want to # make the protocol part react somehow. Currently we just apply the # changed license to new connections, not old ones. # Wake up Ajax waiters self._ajax_helper.wake_status_change_waiters() # Boot code (update) needs a snapshot of a "known good" network config. # If the management connection comes up, we are quite sure the config # is good, at least for updating. if self.l2tpmanager.isRunning(): try: self._export_rdf_database() except: _log.exception("failed to export rdf database") # If we don't have a test license at this point, request one now try: self._test_license_check() except: _log.exception("_test_license_check failed") # XXX: to ensure that the test license makes it to the exported "known good" # configuration ASAP, we might want to export the known good configuration # again when the test license is received. try: helpers.get_global_status().setS(ns.managementServerConnection, rdf.Boolean, True) except: _log.exception("cannot set management connection rdf status to up")