fix bugs
[sfa.git] / sfa / methods / get_gids.py
index 359a947..6a5fe69 100644 (file)
@@ -28,7 +28,7 @@ class get_gids(Method):
     
     accepts = [
         Parameter(str, "Certificate string"),
-        Mixed(Paramter(str, "Human readable name (hrn)"), 
+        Mixed(Parameter(str, "Human readable name (hrn)"), 
               Parameter([str], "List of Human readable names (hrn)")), 
         Mixed(Parameter(str, "Request hash"),
               Parameter(None, "Request hash not specified")) 
@@ -40,6 +40,8 @@ class get_gids(Method):
         self.api.auth.authenticateCred(cred, [cred, hrns], request_hash)
         self.api.auth.check(cred, 'getgids')
         table = GeniTable()
-        records = table.find({'hrn': [hrns]}, columns=['hrn','type','gid'])
+        if not isinstance(hrns, list):
+            hrns = [hrns]
+        records = table.find({'hrn': hrns}, columns=['hrn','type','gid'])
         
         return records