var paths is a str like 'salt://kvm/qemu.conf,salt://kvm/init.sls'
when loop it,got a str 's',not 'salt://kvm/qemu.conf'
got error:
```
[root@localhost _modules]# salt 'minion1' cp.cache_files salt://kvm/qemu.conf,salt://kvm/init.sls
<type 'str'>
cache_files
['salt://kvm/qemu.conf,salt://kvm/init.sls'] {}
salt://kvm/qemu.conf,salt://kvm/init.sls
testtttt salt://kvm/qemu.conf,salt://kvm/init.sls
minion1:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/minion.py", line 426, in _thread_return
ret['return'] = func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/salt/modules/cp.py", line 240, in cache_files
return __context__['cp.fileclient'].cache_files(paths, env)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 126, in cache_files
ret.append(self.cache_file(path, env))
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 116, in cache_file
return self.get_url(path, '', True, env)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 336, in get_url
with contextlib.closing(url_open(url)) as srcfp:
File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib64/python2.6/urllib2.py", line 384, in open
protocol = req.get_type()
File "/usr/lib64/python2.6/urllib2.py", line 245, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: s
```
This requisite allows a state to be executed only if the required
state is expected to make changes to the system in the future.
So, if a script should only be run if a file is about to be changed
this can do it, or run a command BEFORE the system updates software.
This is useful to shut down a service before instaling an upgrade
and then restart the service after the upgrade
@jacksontj, you owe me a totorial or some docs on this one, I had
to seriously rack my brain to pull it off :) It is hard to find
out what is going to happen in the future!!
BTW, this is still experimental, and I have been able to get a
recursive loop with bad syntax, so be careful!
The Depends decorator allows you to optionally remove functions if sepecific globals/modules don't exist. This is particuarly helpful in larger scale deployments where some functions of the module work everywhere, but others require (for example) a service to be installed. This way you can avoid having to try/except all over the module to only load certain functions etc.