rabbah commented on a change in pull request #3418: support cleanup of 
cloudant/kafka trigger dbs
URL: 
https://github.com/apache/incubator-openwhisk/pull/3418#discussion_r173819715
 
 

 ##########
 File path: tools/db/cleanUpWhisks.py
 ##########
 @@ -95,56 +98,108 @@ def deleteWhisk(dbWhisks, wdoc):
 def checkNamespace(dbSubjects, namespace):
 
     while True:
-
         allNamespaces = dbSubjects.view('subjects/identities', 
startkey=[namespace], endkey=[namespace])
-
         if allNamespaces:
             return True
         else:
             return False
 
 
+#
+# update last namespace info and print number of kept documents
+#
+def updateLastNamespaceInfo(namespace, lastNamespaceInfo):
+
+    if namespace != lastNamespaceInfo[0]:
+        if lastNamespaceInfo[0] != None:
+            print('keeping: {0} doc(s) for namespace 
{1}'.format(lastNamespaceInfo[1], lastNamespaceInfo[0]))
+        lastNamespaceInfo = (namespace,0)
+    lastNamespaceInfo = (namespace, lastNamespaceInfo[1]+1)
+    return lastNamespaceInfo
+
+
+#
+# get delimiters for namespace retrieval by database type
+#
+def getDelimiters(whiskDatabaseType):
+
+    if whiskDatabaseType == "whisks":
+        # "_id": "whisk.system/utils",
+        return None, '/'
+    elif whiskDatabaseType == "cloudanttrigger":
+        # "_id": ":AHA04676_dev:vision-cloudant-trigger",
 
 Review comment:
   Right, thanks for following up. I am asking if the delimiter can be generic 
parameter (or the parts relayed differently) as opposed to teaching this script 
about the various databases for providers which are orthogonal to the openwhisk 
backend.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to