def exit (self, tokeniser): asn = self.extract_anonymous('asn',tokeniser) if asn: if 'asn' in self.content: raise RaisedSession(tokeniser,"can not have amed and anonymous 'asn' in a session") self.content['asn'] = asn if 'asn' not in self.content: raise RaisedSession(tokeniser,"section is missing a 'asn' section") capability = self.extract_anonymous('capability',tokeniser) if capability: if 'capability' in self.content: raise RaisedSession(tokeniser,"can not have amed and anonymous 'capability' in a session") self.content['capability'] = capability if 'capability' not in self.content: raise RaisedSession(tokeniser,"section is missing a 'capability' section") if 'router-id' not in self.content: # 0.0.0.0 is now a invlid router-id so it will be replaced by the bind ip self.content['router-id'] = ip(lambda:'0.0.0.0') if 'hold-time' not in self.content: self.content['hold-time'] = holdtime(lambda:'180')
def exit(self, tokeniser): asn = self.extract_anonymous('asn', tokeniser) if asn: if 'asn' in self.content: raise RaisedSession( tokeniser, "can not have amed and anonymous 'asn' in a session") self.content['asn'] = asn if 'asn' not in self.content: raise RaisedSession(tokeniser, "section is missing a 'asn' section") capability = self.extract_anonymous('capability', tokeniser) if capability: if 'capability' in self.content: raise RaisedSession( tokeniser, "can not have amed and anonymous 'capability' in a session" ) self.content['capability'] = capability if 'capability' not in self.content: raise RaisedSession(tokeniser, "section is missing a 'capability' section") if 'router-id' not in self.content: # 0.0.0.0 is now a invlid router-id so it will be replaced by the bind ip self.content['router-id'] = ip(lambda: '0.0.0.0') if 'hold-time' not in self.content: self.content['hold-time'] = holdtime(lambda: '180')
def hold_time (self, tokeniser): try: self.content['hold-time'] = holdtime(tokeniser) except ValueError,exc: raise RaisedSession(tokeniser,'could not parse hold-time, %s' % str(exc))
def hold_time(self, tokeniser): try: self.content['hold-time'] = holdtime(tokeniser) except ValueError, exc: raise RaisedSession(tokeniser, 'could not parse hold-time, %s' % str(exc))