aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-09-05 20:51:29 +0000
committerRob Austein <sra@hactrn.net>2009-09-05 20:51:29 +0000
commit960282049fbd81c1cd26e86d3461b42ed35d80dd (patch)
tree9093fc57282c7b82042433657c5b3bdbeb0986ce
parent9d1c503836dc2d67042cf0509bf0f97c913317d4 (diff)
Comment and cleanup
svn path=/rpkid/rpki/left_right.py; revision=2741
-rw-r--r--rpkid/rpki/left_right.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/rpkid/rpki/left_right.py b/rpkid/rpki/left_right.py
index 3386a127..c64204b5 100644
--- a/rpkid/rpki/left_right.py
+++ b/rpkid/rpki/left_right.py
@@ -99,17 +99,17 @@ class data_elt(rpki.xml_utils.data_elt, rpki.sql.sql_persistent, left_right_name
"""
Hook to do _handle => _id translation before saving.
- self and q_pdu may be the same object; when they are, this is a
- create operation, when they're not, this is a set operation and
- self is the pre-existing object from sql.
+ self is always the object to be saved to SQL. For create
+ operations, self and q_pdu are be the same object; for set
+ operations, self is the pre-existing object from SQL and q_pdu is
+ the set request received from the the IRBE.
"""
for tag, elt in self.handles:
id_name = tag + "_id"
if getattr(self, id_name, None) is None:
- handle_name = tag + "_handle"
- x = elt.serve_fetch_handle(self.gctx, self.self_id, getattr(q_pdu, handle_name))
+ x = elt.serve_fetch_handle(self.gctx, self.self_id, getattr(q_pdu, tag + "_handle"))
if x is None:
- raise rpki.exceptions.HandleTranslationError, "Could not translate %r %r %r" % (handle_name, self, q_pdu)
+ raise rpki.exceptions.HandleTranslationError, "Could not translate %r %s_handle" % (self, tag)
setattr(self, id_name, getattr(x, id_name))
cb()