diff options
author | Rob Austein <sra@hactrn.net> | 2007-12-14 22:17:21 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-12-14 22:17:21 +0000 |
commit | f366be0ee56b3d609cb65d1265fd5d7ee01a3fe5 (patch) | |
tree | e89241cd89b9c67bdf01403299dcaab349a26069 /scripts/rpki | |
parent | 423f7891445b06ae639ad994e1fe989e1bbe1e39 (diff) |
Add make_pdu() to simplify writing IRBE control scripts.
svn path=/scripts/biz-certs/Bob-CA.srl; revision=1380
Diffstat (limited to 'scripts/rpki')
-rw-r--r-- | scripts/rpki/left_right.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/rpki/left_right.py b/scripts/rpki/left_right.py index 10beb452..38e44b5c 100644 --- a/scripts/rpki/left_right.py +++ b/scripts/rpki/left_right.py @@ -69,6 +69,14 @@ class data_elt(base_elt, rpki.sql.sql_persistant): """Return BSC object to which this object links.""" return bsc_elt.sql_fetch(gctx, self.bsc_id) + @classmethod + def make_pdu(cls, **kargs): + """Generic left-right PDU constructor.""" + self = cls() + for k,v in kargs.items(): + setattr(self, k, v) + return self + def make_reply(self, r_pdu = None): """Construct a reply PDU.""" if r_pdu is None: |