def _reconnect( self ): try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) self.log = client.get_proxy( 'log' ) # on reconnection retrieve static info self.ancestors = self.sinfo.get('first-parent ancestors' ) self.ancestors_pruned = self.sinfo.get( 'first-parent ancestors', True ) self.descendants = self.sinfo.get( 'first-parent descendants' ) self.all_families = self.sinfo.get( 'all families' ) self.triggering_families = self.sinfo.get( 'triggering families' ) self.live_graph_movie, self.live_graph_dir = self.sinfo.get( 'do live graph movie' ) except Exception, x: #print str(x) # (port file not found, if suite not running) if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) self._flag_new_update() return False
def _reconnect(self): """Connect to the suite daemon and get Pyro client proxies.""" self.god = None self.sinfo = None self.log = None try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) self.log = client.get_proxy( 'log' ) self._retrieve_hierarchy_info() except Exception, x: # (port file not found, if suite not running) if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) self._flag_new_update() return False
def reconnect( self ): # set debug here to see how reconnection works debug = False try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) # on reconnection retrieve static info self.descendants = self.sinfo.get('first-parent descendants' ) self.ancestors = self.sinfo.get('first-parent ancestors' ) except: # connection lost if debug: print ".", if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if self.stop_summary is not None and any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.status = "connected" self.poll_schd.stop() self.info_bar.set_status( self.status ) return True
def reconnect( self ): try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) # on reconnection retrieve static info self.ancestors = self.sinfo.get( 'first-parent ancestors' ) self.families = self.sinfo.get( 'first-parent descendants' ) self.allowed_families = self.sinfo.get( 'vis families' ) except: if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if self.stop_summary is not None and any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.status = "connected" self.poll_schd.stop() return True
def reconnect( self ): self.prev_graph_id = () try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.sinfo = client.get_proxy( 'suite-info' ) # on reconnection retrieve static info self.family_nodes = self.sinfo.get( 'family nodes' ) self.graphed_family_nodes = self.sinfo.get( 'graphed family nodes' ) self.descendants = self.sinfo.get( 'first-parent descendants' ) self.ancestors = self.sinfo.get('first-parent ancestors' ) self.live_graph_movie, self.live_graph_dir = self.sinfo.get( 'do live graph movie' ) except: # connection lost if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if self.stop_summary is not None and any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.status = "connected" self.first_update = True self.info_bar.set_status( self.status ) if self.live_graph_movie: try: mkdir_p( self.live_graph_dir ) except Exception, x: print >> sys.stderr, x print >> sys.stderr, "Disabling live graph movie" self.live_graph_movie = False self.first_update = True self.status = "connected" self.poll_schd.stop() self.info_bar.set_status( self.status ) return True
def reconnect( self ): try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.remote = client.get_proxy( 'remote' ) except Exception, x: if self.stop_summary is None: self.stop_summary = cylc.dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False
def reconnect( self ): try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) self.remote = client.get_proxy( 'remote' ) except: if self.stop_summary is None: self.stop_summary = dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.family_nodes = self.remote.get_family_nodes() self.graphed_family_nodes = self.remote.get_graphed_family_nodes() self.families = self.remote.get_families() self.live_graph_movie, self.live_graph_dir = self.remote.do_live_graph_movie() if self.live_graph_movie: try: mkdir_p( self.live_graph_dir ) except Exception, x: print >> sys.stderr, x raise SuiteConfigError, 'ERROR, illegal dir? ' + self.live_graph_dir self.status = "connected" self.info_bar.set_status( self.status ) return True
def reconnect( self ): try: client = cylc_pyro_client.client( self.cfg.suite, self.cfg.pphrase, self.cfg.owner, self.cfg.host, self.cfg.pyro_timeout, self.cfg.port ) self.god = client.get_proxy( 'state_summary' ) except: if self.stop_summary is None: self.stop_summary = cylc.dump.get_stop_state_summary( self.cfg.suite, self.cfg.owner, self.cfg.host) if any(self.stop_summary): self.info_bar.set_stop_summary(self.stop_summary) return False else: self.stop_summary = None self.status = "connected" self.info_bar.set_status( self.status ) return True