From 2fe9e3b58e23b241e061968298a6d86f600e27e3 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Wed, 4 Jan 2012 22:04:56 -0700 Subject: [PATCH] fix issues in module sync --- salt/modules/saltutil.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/salt/modules/saltutil.py b/salt/modules/saltutil.py index 507d89da99..362eabd1f9 100644 --- a/salt/modules/saltutil.py +++ b/salt/modules/saltutil.py @@ -4,6 +4,8 @@ used to manage minion modules as well as automate updates to the salt minion ''' import os +import hashlib +import shutil import logging log = logging.getLogger(__name__) @@ -13,12 +15,10 @@ def _sync(form, env): Sync the given directory in the given environment ''' ret = [] - source = os.path.join('salt://{0}'.format(env), '_{0}'.format(form)) - mod_dir = os.path.join(__opts__['extention_modules'], '{0}'.format(form)) + source = os.path.join('salt://_{0}'.format(form)) + mod_dir = os.path.join(__opts__['extension_modules'], '{0}'.format(form)) if not os.path.isdir(mod_dir): - # Specified a non existing module type - log.error('Failed to sync modules for {0}'.format(directory)) - return ret + os.makedirs(mod_dir) for fn_ in __salt__['cp.cache_dir'](source, env): dest = os.path.join(mod_dir, os.path.basename(fn_)