diff options
author | Rob Austein <sra@hactrn.net> | 2009-04-02 00:53:00 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-04-02 00:53:00 +0000 |
commit | 54f00649dac64967dfdc345f933bceddce84be1c (patch) | |
tree | 37ca0e3f2e9183ab2db4c924914e358ba57e1675 /rtr-origin | |
parent | aec71f8e3f01ed71e100eb9bb1bc3a0ddf382c46 (diff) |
Checkpoint
svn path=/rtr-origin/updater.py; revision=2300
Diffstat (limited to 'rtr-origin')
-rwxr-xr-x | rtr-origin/updater.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rtr-origin/updater.py b/rtr-origin/updater.py index 80d2130b..c10b69cc 100755 --- a/rtr-origin/updater.py +++ b/rtr-origin/updater.py @@ -344,6 +344,18 @@ class prefix_set(list): f.write(p.to_pdu()) f.close() + def mark_current(self): + """Mark the current serial number as current.""" + tmpfn = "current.%d.tmp" % os.getpid() + try: + f = open(tmpfn, "w") + f.write("%d\n" % self.serial) + f.close() + os.rename(tmpfn, "current") + except: + os.unlink(tmpfn) + raise + def save_ixfr(self, other): """Comparing this prefix_set with an older one and write the resulting IXFR-style prefix-set to file with magic filename. @@ -376,6 +388,7 @@ def test(): p.save_axfr() for a in axfrs: p.save_ixfr(a) + p.mark_current() axfrs.append(p) time.sleep(2) |