From 4e0970c5ac14e2a3bdf604872ceaa35bcc57aef1 Mon Sep 17 00:00:00 2001 From: Bartosz Bubak Date: Tue, 25 Apr 2017 20:47:29 +0200 Subject: [PATCH] Added context kubectlpath configuration --- ausroller/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ausroller/config.py b/ausroller/config.py index 47200e6..0a31b92 100644 --- a/ausroller/config.py +++ b/ausroller/config.py @@ -86,6 +86,15 @@ def read_config(self): logging.error("Missing section {} in configuration file {}. Abort execution.".format( section, self.configfile)) sys.exit(1) + + # If kubectlpath is defined in context section use it instead of default one + logging.debug('Try to read context related kubectlpath config') + try: + self.contextkubectlpath = cp.get(self.context, 'kubectlpath') + logging.debug('Context kubectlpath found ({})'.format(self.contextkubectlpath)) + self.kubectlpath = self.contextkubectlpath + except: + logging.debug('No extra kubectlpath in context section') if not self.kubectlpath: logging.warn("Trying to use default 'kubectl' from PATH")