Code Duplication    Length = 18-18 lines in 2 locations

lib/exabgp/bgp/message/update/attribute/sr/prefixsid.py 1 location

@@ 79-96 (lines=18) @@
76
		return self._packed
77
78
79
class GenericSRId(object):
80
	TLV = 99998
81
82
	def __init__ (self, code, rep):
83
		self.rep = rep
84
		self.code = code
85
86
	def __repr__ (self):
87
		return "Attribute with code [ %s ] not implemented" % (self.code)
88
89
	@classmethod
90
	def unpack (cls,scode,data):
91
		length = len(data)
92
		info = binascii.b2a_uu(data[:length])
93
		return cls(code=scode,rep=info)
94
95
	def json (self,compact=None):
96
		return '"attribute-not-implemented": "%s"' % (self.code)
97

lib/exabgp/bgp/message/update/attribute/bgpls/linkstate.py 1 location

@@ 78-95 (lines=18) @@
75
		return ', '.join(str(d) for d in self.ls_attrs)
76
77
78
class GenericLSID(object):
79
	TLV = 99999
80
81
	def __init__ (self, code, rep):
82
		self.rep = rep
83
		self.code = code
84
85
	def __repr__ (self):
86
		return "Attribute with code [ %s ] not implemented" % (self.code)
87
88
	@classmethod
89
	def unpack (cls,scode,data):
90
		length = len(data)
91
		info = binascii.b2a_uu(data[:length])
92
		return cls(code=scode,rep=info)
93
94
	def json (self,compact=None):
95
		return '"attribute-not-implemented": "%s"' % (self.code)
96
97
98
class LsGenericFlags(object):