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

This commit is contained in:
Liam Young 2015-08-03 15:01:27 +01:00
parent 6535d40c78
commit 5cf3103423

View File

@ -34,7 +34,22 @@ import errno
import tempfile import tempfile
from subprocess import CalledProcessError 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 import six
if not six.PY3: if not six.PY3: