Skip to content

Commit

Permalink
Merge pull request #11 from mirceaulinic/sproxy-path
Browse files Browse the repository at this point in the history
Correct bug introduced yesterday in 2021.2.1
  • Loading branch information
mirceaulinic authored Feb 19, 2021
2 parents f09651f + 8bbc600 commit 56cfa46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions isalt/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,16 @@ def _napalm_is_proxy(opts):
proxy=__proxy__,
)
else:
if not os.path.exists(__opts__['cachedir']):
try:
os.mkdir(__opts__['cachedir'])
except OSError as ose:
print(
'Unable to create the cache directory',
__opts__['cachedir'],
'please make sure you are running ISalt with the correct permissions',
)
raise ose
if role == 'minion':
sminion = salt.minion.SMinion(__opts__)
else:
Expand Down Expand Up @@ -330,16 +340,14 @@ def _napalm_is_proxy(opts):
file_roots.append(sproxy_path)
__opts__['file_roots'][saltenv] = file_roots
sproxy_dirs = [
sproxy_dir
(sproxy_dir[:-1] if sproxy_dir[-1] == 's' else sproxy_dir)
for sproxy_dir in os.listdir(sproxy_path)
if sproxy_dir.startswith('_')
and not sproxy_dir.startswith('__')
and os.path.isdir(os.path.join(sproxy_path, sproxy_dir))
]
for sproxy_dir in sproxy_dirs:
sproxy_dirs_opts = '{}_dirs'.format(
sproxy_dir.replace('_', '', 1).replace('s', '', -1)
)
sproxy_dirs_opts = '{}_dirs'.format(sproxy_dir.replace('_', '', 1))
if sproxy_dirs_opts not in __opts__:
__opts__[sproxy_dirs_opts] = []
sproxy_dir_path = os.path.join(sproxy_path, sproxy_dir)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name='isalt',
version='2021.2.1',
version='2021.2.2',
namespace_packages=['isalt'],
packages=find_packages(),
author='Mircea Ulinic',
Expand Down

0 comments on commit 56cfa46

Please sign in to comment.