Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ausroller/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't create a member for this just use a local variable.

logging.debug('Context kubectlpath found ({})'.format(self.contextkubectlpath))
self.kubectlpath = self.contextkubectlpath
except:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not catch every exception

logging.debug('No extra kubectlpath in context section')

if not self.kubectlpath:
logging.warn("Trying to use default 'kubectl' from PATH")
Expand Down