saltstack/salt — pull request #1769 by amuraru (2012-08-04 23:13:29+00:00)
Title: Fixed sync and reload of custom modules bundled in packages

Hi,

Just found that previously checked in patch for remote salt modules bundled as packages is not complete.
This patch is improving in the following areas:
- updated loader to fix a check in `gen_functions` used at runtime by the minion
- updated `saltutil.sync_modules` to support package dir sync and reload

My test flow consist of:
1. start master and one minion
2. add a new package dir in /srv/salt/_modules like:
```
mysuite/
__init__.py
remote.py
_utils.py
```

where `remote.py` defines two custom commands:
```
def mymethod1():
return "method1"

def mymethod2():
return "method2"
```

and `__init__.py` exports them to `mysuite` level:
```
from remote import *
```

3. Sync modules `$ salt \* saltutil.sync_modules`

4. Use the new commands: `$ salt \* mysuite.method1`