Fix bug 742
[osm/NBI.git] / osm_nbi / engine.py
index e7dee84..d8409ea 100644 (file)
@@ -128,17 +128,17 @@ class Engine(object):
                         if path.isfile(config_file):
                             resources_to_operations_file = config_file
                             break
-                    if not resources_to_operations_file:                        
+                    if not resources_to_operations_file:                   
                         raise EngineException("Invalid permission configuration: resources_to_operations file missing")
-                
+
                 with open(resources_to_operations_file, 'r') as f:
                     resources_to_operations = yaml.load(f)
-                
+
                 self.operations = []
 
                 for _, value in resources_to_operations["resources_to_operations"].items():
                     if value not in self.operations:
-                        self.operations += value
+                        self.operations += [value]
 
             if config["authentication"]["backend"] == "keystone":
                 self.map_from_topic_to_class["users"] = UserTopicAuth
@@ -388,5 +388,7 @@ class Engine(object):
             self.upgrade_db(db_version, target_version)
 
         # create user admin if not exist
-        self.create_admin()
+        if not self.auth:
+            self.create_admin()
+        
         return