saltstack/salt — pull request #2074 by thekuffs (2012-09-23 22:32:40+00:00)
Title: Catch AttributeError on yumpkg import test

This resolves an issue with frightening looking error message from the ```brew``` module.

```
[WARNING ] Failed to import module brew, this is due most likely to a syntax error: Traceback (most recent call last):
File "salt/loader.py", line 412, in gen_functions
), fn_, path, desc
File "salt/modules/brew.py", line 2, in
from salt.modules.yumpkg import _compare_versions
File "salt/modules/yumpkg.py", line 7, in
import yum
File "yum/__init__.py", line 49, in
AttributeError: 'module' object has no attribute 'i18n'
```

This occurs on my frozen CentOS -> Ubuntu builds.

It comes about because the ```brew``` module is importing ```_compare_versions()``` from ```salt.modules.yumpkg```. On this kind of installation, the ```import yum``` in the ```yumpkg``` module failing from an AttributeError rather than an ImportError. Must be looking for some file on the system or something.