You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/28 11:02:09 UTC

[GitHub] chetanmeh commented on a change in pull request #3369: Use pureconfig for CouchDbRestStore

chetanmeh commented on a change in pull request #3369: Use pureconfig for CouchDbRestStore
URL: https://github.com/apache/incubator-openwhisk/pull/3369#discussion_r171209657
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/database/CouchDbStoreProvider.scala
 ##########
 @@ -36,21 +47,18 @@ object CouchDbStoreProvider extends ArtifactStoreProvider {
     actorSystem: ActorSystem,
     logging: Logging,
     materializer: ActorMaterializer): ArtifactStore[D] = {
-    require(config != null && config.isValid, "config is undefined or not valid")
+    val dbConfig = loadConfigOrThrow[CouchDbConfig](ConfigKeys.couchdb)
     require(
-      config.dbProvider == "Cloudant" || config.dbProvider == "CouchDB",
-      "Unsupported db.provider: " + config.dbProvider)
-    assume(
-      Set(config.dbProtocol, config.dbHost, config.dbPort, config.dbUsername, config.dbPassword, name(config))
-        .forall(_.nonEmpty),
-      "At least one expected property is missing")
+      dbConfig.provider == "Cloudant" || dbConfig.provider == "CouchDB",
+      s"Unsupported db.provider: ${dbConfig.provider}")
 
 Review comment:
   Not sure what is the intention of provider so far. In code this param is not used. I just kept existing logic as is with switch to pureconfig. If provider is not required (if others can confirm) I can then remove that also

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services