git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baf1455
)
when deleting a slice, do not remove corresponding leases
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Mon, 14 Oct 2024 14:04:11 +0000
(16:04 +0200)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Mon, 14 Oct 2024 14:04:11 +0000
(16:04 +0200)
PLC/Slices.py
patch
|
blob
|
history
diff --git
a/PLC/Slices.py
b/PLC/Slices.py
index
f27e5d0
..
276754c
100644
(file)
--- a/
PLC/Slices.py
+++ b/
PLC/Slices.py
@@
-254,7
+254,9
@@
class Slice(Row):
assert 'slice_id' in self
# Clean up miscellaneous join tables
- for table in self.join_tables:
+ # however, we want to preserve leases for accounting purposes
+ to_delete = [table for table in self.join_tables if table != 'leases']
+ for table in to_delete:
self.api.db.do(
f"DELETE FROM {table} WHERE slice_id = {self['slice_id']}")