diff --git a/pepper/cli.py b/pepper/cli.py index b6d97fb..cbf64c0 100644 --- a/pepper/cli.py +++ b/pepper/cli.py @@ -8,9 +8,14 @@ import optparse import os import textwrap -import ConfigParser import getpass import time +try: + # Python 3 + from configparser import ConfigParser +except ImportError: + # Python 2 + import ConfigParser import pepper @@ -191,7 +196,10 @@ def get_login_details(self): 'SALTAPI_EAUTH': 'auto', } - config = ConfigParser.RawConfigParser() + try: + config = ConfigParser(interpolation=None) + except TypeError as e: + config = ConfigParser.RawConfigParser() config.read(self.options.config) # read file @@ -324,7 +332,7 @@ def run(self): load = self.parse_cmd() creds = iter(self.parse_login()) - api = pepper.Pepper(creds.next(), debug_http=self.options.debug_http, ignore_ssl_errors=self.options.ignore_ssl_certificate_errors) + api = pepper.Pepper(next(creds), debug_http=self.options.debug_http, ignore_ssl_errors=self.options.ignore_ssl_certificate_errors) auth = api.login(*list(creds)) if self.options.fail_if_minions_dont_respond: diff --git a/setup.py b/setup.py index 66de9b7..c38a7bc 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,8 @@ def parse_version_tag(tag): Returns a tuple of the version number, number of commits (if any), and the Git SHA (if available). ''' + if isinstance(tag, bytes): + tag = tag.decode() if not tag or '-g' not in tag: return tag, None, None