git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a172efc
)
do not interfaces defined in registries.xml aggregates.xml if required fields arent...
author
Tony Mack
<tmack@cs.princeton.edu>
Tue, 11 May 2010 17:00:28 +0000
(17:00 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Tue, 11 May 2010 17:00:28 +0000
(17:00 +0000)
sfa/server/interface.py
patch
|
blob
|
history
diff --git
a/sfa/server/interface.py
b/sfa/server/interface.py
index
0503479
..
4ae8e9f
100644
(file)
--- a/
sfa/server/interface.py
+++ b/
sfa/server/interface.py
@@
-61,8
+61,17
@@
class Interfaces(dict):
if not isinstance(interfaces, list):
interfaces = [self.interfaces]
self.interfaces = {}
if not isinstance(interfaces, list):
interfaces = [self.interfaces]
self.interfaces = {}
+ required_fields = self.default_fields.keys()
for interface in interfaces:
for interface in interfaces:
- self.interfaces[interface['hrn']] = interface
+ valid = True
+ # skp any interface definition that has a null hrn,
+ # address or port
+ for field in required_fields:
+ if field not in interface or not interface[field]:
+ valid = False
+ break
+ if valid:
+ self.interfaces[interface['hrn']] = interface
def sync_interfaces(self):
def sync_interfaces(self):