for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# encoding: utf-8
"""
admingroup.py
Created by Evelio Vila on 2016-12-01.
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
from struct import unpack
from exabgp.bgp.message.notification import Notify
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState
@LinkState.register()
class AdminGroup(object):
TLV = 1088
def __init__(self, colormask):
self.colormask = colormask
def __repr__(self):
return "Admin Group mask: %s" % (self.colormask)
@classmethod
def unpack(cls, data, length):
if length != 4:
raise Notify(3, 5, "Unable to decode attribute. Incorrect Size")
colormask = unpack('!L', data[:4])[0]
return cls(colormask=colormask)
def json(self, compact=None):
return '"admin-group-mask": %s' % self.colormask