[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:20 +01:00
parent 86d6f3afa2
commit acca6399c1
1 changed files with 16 additions and 1 deletions

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: