[gnuoy,trivial] Pre-release charmhelper sync to pickup leadership election peer migration fix

This commit is contained in:
Liam Young 2015-08-03 14:59:32 +01:00
parent 46dda298c8
commit dad203ed1e

View File

@ -34,7 +34,22 @@ import errno
import tempfile
from subprocess import CalledProcessError
from charmhelpers.cli import cmdline
try:
from charmhelpers.cli import cmdline
except ImportError as e:
# due to the anti-pattern of partially synching charmhelpers directly
# into charms, it's possible that charmhelpers.cli is not available;
# if that's the case, they don't really care about using the cli anyway,
# so mock it out
if str(e) == 'No module named cli':
class cmdline(object):
@classmethod
def subcommand(cls, *args, **kwargs):
def _wrap(func):
return func
return _wrap
else:
raise
import six
if not six.PY3: