git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix bug (make sure we are removing the correct records
[sfa.git]
/
sfa
/
server
/
interface.py
diff --git
a/sfa/server/interface.py
b/sfa/server/interface.py
index
489d88b
..
5ccb7ee
100644
(file)
--- a/
sfa/server/interface.py
+++ b/
sfa/server/interface.py
@@
-145,11
+145,9
@@
class Interfaces(dict):
"""
if not gids:
return
"""
if not gids:
return
- # get hrns we expect to find
- # ignore records for local interfaces
- ignore_interfaces = [self.api.config.SFA_INTERFACE_HRN]
- hrns_expected = [gid.get_hrn() for gid in gids \
- if gid.get_hrn() not in ignore_interfaces]
+
+ # hrns that should have a record
+ hrns_expected = [gid.get_hrn() for gid in gids]
# get hrns that actually exist in the db
table = SfaTable()
# get hrns that actually exist in the db
table = SfaTable()
@@
-158,7
+156,8
@@
class Interfaces(dict):
# remove old records
for record in records:
# remove old records
for record in records:
- if record['hrn'] not in hrns_expected:
+ if record['hrn'] not in hrns_expected and \
+ record['hrn'] != self.api.config.SFA_INTERFACE_HRN:
table.remove(record)
# add new records
table.remove(record)
# add new records