Not all environments require https scheduler. So start it only if ca certificate exists.
Signed-off-by: Wu Zhende wuzhende666@163.com --- container/scheduler-https/start | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/container/scheduler-https/start b/container/scheduler-https/start index 38c4892..6d6dda0 100755 --- a/container/scheduler-https/start +++ b/container/scheduler-https/start @@ -6,6 +6,9 @@ require 'set' require_relative '../defconfig.rb'
+warning = 'CA certificate is missing.Ignore if the HTTPS scheduler is not required' +raise warning unless File.exist?('/etc/compass-ci/ca/server.crt') && File.exist?('/etc/compass-ci/ca/server.key') + names = Set.new %w[ SCHED_HOST SCHED_PORT
On Thu, Nov 12, 2020 at 02:49:45PM +0800, Wu Zhende wrote:
Not all environments require https scheduler. So start it only if ca certificate exists.
Signed-off-by: Wu Zhende wuzhende666@163.com
container/scheduler-https/start | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/container/scheduler-https/start b/container/scheduler-https/start index 38c4892..6d6dda0 100755 --- a/container/scheduler-https/start +++ b/container/scheduler-https/start @@ -6,6 +6,9 @@ require 'set' require_relative '../defconfig.rb'
+warning = 'CA certificate is missing.Ignore if the HTTPS scheduler is not required'
How about use warning_msg?
Thanks, Xijian
+raise warning unless File.exist?('/etc/compass-ci/ca/server.crt') && File.exist?('/etc/compass-ci/ca/server.key')
names = Set.new %w[ SCHED_HOST SCHED_PORT -- 2.23.0
the title : ca => CA
On Thu, Nov 12, 2020 at 02:49:45PM +0800, Wu Zhende wrote:
Not all environments require https scheduler. So start it only if ca certificate exists.
^----ca => CA perhaps better like this.
Signed-off-by: Wu Zhende wuzhende666@163.com
container/scheduler-https/start | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/container/scheduler-https/start b/container/scheduler-https/start index 38c4892..6d6dda0 100755 --- a/container/scheduler-https/start +++ b/container/scheduler-https/start @@ -6,6 +6,9 @@ require 'set' require_relative '../defconfig.rb'
+warning = 'CA certificate is missing.Ignore if the HTTPS scheduler is not required' +raise warning unless File.exist?('/etc/compass-ci/ca/server.crt') && File.exist?('/etc/compass-ci/ca/server.key')
too long line, and use variable. perhaps change like this:
ca_path=/etc/compass-ci/ca raise warning unless File.exist?('#{ca_path}/server.crt') && File.exist?('#{ca_path}/server.key') Thanks, Liushaofei
names = Set.new %w[ SCHED_HOST SCHED_PORT -- 2.23.0