mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #13511 from cachedout/more_gitfs_fix
Create gitfs cache dir if does not exist
This commit is contained in:
commit
82c8440f09
2 changed files with 3 additions and 0 deletions
|
@ -1150,6 +1150,8 @@ def file_hash(load, fnd):
|
|||
'{0}.hash.{1}'.format(relpath,
|
||||
__opts__['hash_type']))
|
||||
if not os.path.isfile(hashdest):
|
||||
if not os.path.exists(os.path.dirname(hashdest)):
|
||||
os.makedirs(os.path.dirname(hashdest))
|
||||
with salt.utils.fopen(path, 'rb') as fp_:
|
||||
ret['hsum'] = getattr(hashlib, __opts__['hash_type'])(
|
||||
fp_.read()).hexdigest()
|
||||
|
|
|
@ -131,6 +131,7 @@ class GitFSTest(integration.ModuleCase):
|
|||
'sock_dir': self.master_opts['sock_dir'],
|
||||
'hash_type': 'sha1'}):
|
||||
tmp_load = LOAD.copy()
|
||||
tmp_load['loc'] = 0
|
||||
tmp_load['path'] = 'testfile'
|
||||
fnd = {'rel': 'testfile',
|
||||
'path': 'testfile'}
|
||||
|
|
Loading…
Add table
Reference in a new issue