Skip to content

Commit

Permalink
Don't depend on the pecl return code because it's broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Place committed Nov 23, 2013
1 parent 23d0680 commit e7ba42f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion salt/modules/pecl.py
Expand Up @@ -19,6 +19,9 @@

log = logging.getLogger(__name__)

def __virtual__():
return True if salt.utils.which('pecl') else False


def _pecl(command, defaults=False):
'''
Expand Down Expand Up @@ -66,8 +69,14 @@ def install(pecls, defaults=False, force=False, preferred_state='stable'):
return _pecl('{0} install -f {1}'.format(preferred_state, pecls),
defaults=defaults)
else:
return _pecl('{0} install {1}'.format(preferred_state, pecls),
_pecl('{0} install {1}'.format(preferred_state, pecls),
defaults=defaults)
installed_pecls = list_()
for pecl in installed_pecls:
installed_pecl_with_version = '{0}-{1}'.format(pecl, installed_pecls.get(pecl)[0])
if pecls in installed_pecl_with_version:
return True
return False


def uninstall(pecls):
Expand Down

0 comments on commit e7ba42f

Please sign in to comment.