kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch 1.0 updated: KAFKA-6672; ConfigCommand should create config change parent path if needed
Date Sat, 17 Mar 2018 06:47:18 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 1.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/1.0 by this push:
     new 5e9557a  KAFKA-6672; ConfigCommand should create config change parent path if needed
5e9557a is described below

commit 5e9557ad7edcef6e04787b824563ad89368e90f3
Author: Jason Gustafson <jason@confluent.io>
AuthorDate: Fri Mar 16 22:47:35 2018 -0700

    KAFKA-6672; ConfigCommand should create config change parent path if needed
    
    Change `KafkaZkClient.createConfigChangeNotification` to ensure creation of the change
directory. This fixes failing system tests which depend on setting SCRAM credentials prior
to broker startup. Existing test case has been modified for new expected usage.
    
    Reviewers: Ismael Juma <ismael@juma.me.uk>
---
 core/src/main/scala/kafka/admin/AdminUtils.scala    | 2 ++
 core/src/main/scala/kafka/admin/ConfigCommand.scala | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/src/main/scala/kafka/admin/AdminUtils.scala b/core/src/main/scala/kafka/admin/AdminUtils.scala
index 32cab2a..188dac9 100644
--- a/core/src/main/scala/kafka/admin/AdminUtils.scala
+++ b/core/src/main/scala/kafka/admin/AdminUtils.scala
@@ -610,6 +610,8 @@ object AdminUtils extends Logging with AdminUtilities {
   }
 
   private def changeEntityConfig(zkUtils: ZkUtils, rootEntityType: String, fullSanitizedEntityName:
String, configs: Properties) {
+    zkUtils.makeSurePersistentPathExists(ZkUtils.ConfigChangesPath)
+
     val sanitizedEntityPath = rootEntityType + '/' + fullSanitizedEntityName
     val entityConfigPath = getEntityConfigPath(rootEntityType, fullSanitizedEntityName)
     // write the new config--may not exist if there were previously no overrides
diff --git a/core/src/main/scala/kafka/admin/ConfigCommand.scala b/core/src/main/scala/kafka/admin/ConfigCommand.scala
index c0cdff2..fa50fc7 100644
--- a/core/src/main/scala/kafka/admin/ConfigCommand.scala
+++ b/core/src/main/scala/kafka/admin/ConfigCommand.scala
@@ -28,7 +28,7 @@ import kafka.utils.{CommandLineUtils, Exit, ZkUtils}
 import kafka.utils.Implicits._
 import org.apache.kafka.common.security.JaasUtils
 import org.apache.kafka.common.security.scram._
-import org.apache.kafka.common.utils.{Sanitizer, Utils}
+import org.apache.kafka.common.utils.Sanitizer
 
 import scala.collection._
 import scala.collection.JavaConverters._
@@ -76,12 +76,12 @@ object ConfigCommand extends Config {
       }
     } catch {
       case e @ (_: IllegalArgumentException | _: InvalidConfigException | _: OptionException)
=>
-        logger.debug(s"Failed config command with args $args", e)
+        logger.debug(s"Failed config command with args '${args.mkString(" ")}'", e)
         System.err.println(e.getMessage)
         Exit.exit(1)
 
       case t: Throwable =>
-        System.err.println(s"Error while executing config command with args $args")
+        System.err.println(s"Error while executing config command with args '${args.mkString("
")}'")
         t.printStackTrace(System.err)
         Exit.exit(1)
     }

-- 
To stop receiving notification emails like this one, please contact
jgus@apache.org.

Mime
View raw message