From 71448b2898221cfeeeb1f64da8907e7ca6a29a75 Mon Sep 17 00:00:00 2001
From: Masood Malekghassemi <atash@google.com>
Date: Wed, 29 Jun 2016 11:41:24 -0700
Subject: [PATCH] Use open-source defaults to propagate Python plugin
 configuration

---
 src/compiler/python_generator.cc                     | 3 +++
 src/compiler/python_generator.h                      | 1 +
 src/compiler/python_plugin.cc                        | 2 --
 tools/distrib/python/grpcio_tools/grpc/tools/main.cc | 1 -
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index 15cda474cc..c5f1ed8061 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -66,6 +66,9 @@ using std::vector;
 
 namespace grpc_python_generator {
 
+GeneratorConfiguration::GeneratorConfiguration()
+    : grpc_package_root("grpc"), beta_package_root("grpc.beta") {}
+
 PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
     : config_(config) {}
 
diff --git a/src/compiler/python_generator.h b/src/compiler/python_generator.h
index fc51b48dae..7ed99eff0b 100644
--- a/src/compiler/python_generator.h
+++ b/src/compiler/python_generator.h
@@ -43,6 +43,7 @@ namespace grpc_python_generator {
 // Data pertaining to configuration of the generator with respect to anything
 // that may be used internally at Google.
 struct GeneratorConfiguration {
+  GeneratorConfiguration();
   grpc::string grpc_package_root;
   grpc::string beta_package_root;
 };
diff --git a/src/compiler/python_plugin.cc b/src/compiler/python_plugin.cc
index fc76ee5ec6..3457aa631a 100644
--- a/src/compiler/python_plugin.cc
+++ b/src/compiler/python_plugin.cc
@@ -38,8 +38,6 @@
 
 int main(int argc, char* argv[]) {
   grpc_python_generator::GeneratorConfiguration config;
-  config.grpc_package_root = "grpc";
-  config.beta_package_root = "grpc.beta";
   grpc_python_generator::PythonGrpcGenerator generator(config);
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/tools/distrib/python/grpcio_tools/grpc/tools/main.cc b/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
index 81675b4e6f..8391839513 100644
--- a/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
+++ b/tools/distrib/python/grpcio_tools/grpc/tools/main.cc
@@ -45,7 +45,6 @@ int protoc_main(int argc, char* argv[]) {
 
   // gRPC Python
   grpc_python_generator::GeneratorConfiguration grpc_py_config;
-  grpc_py_config.beta_package_root = "grpc.beta";
   grpc_python_generator::PythonGrpcGenerator grpc_py_generator(grpc_py_config);
   cli.RegisterGenerator("--grpc_python_out", &grpc_py_generator,
                         "Generate Python source file.");
-- 
GitLab