reverting last commit (we can attempt to import plcapi source again. The problem...
[sfa.git] / sfa / plc / api.py
index 551f7ea..52f72ff 100644 (file)
@@ -26,7 +26,6 @@ def list_to_dict(recs, key):
     keys = [rec[key] for rec in recs]
     return dict(zip(keys, recs))
 
-
 class SfaAPI(BaseAPI):
 
     # flat list of method names
@@ -70,6 +69,7 @@ class SfaAPI(BaseAPI):
         self.plauth = {'Username': self.config.SFA_PLC_USER,
                        'AuthMethod': 'password',
                        'AuthString': self.config.SFA_PLC_PASSWORD}
+
         try:
             sys.path.append(os.path.dirname(os.path.realpath("/usr/bin/plcsh")))
             self.plshell_type = 'direct'
@@ -403,6 +403,9 @@ class SfaAPI(BaseAPI):
 
         # fill sfa info
         for record in records:
+            # skip records with no pl info (top level authorities)
+            if record['pointer'] == -1:
+                continue 
             sfa_info = {}
             type = record['type']
             if (type == "slice"):