mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #790 from l2ol33rt/develop
Rehashing of CShell after pkgs are installed
This commit is contained in:
commit
fe83dfc437
1 changed files with 16 additions and 0 deletions
|
@ -115,6 +115,7 @@ def install(name, *args, **kwargs):
|
|||
# the package is freshly installed
|
||||
pkgs[npkg] = {'old': '',
|
||||
'new': new[npkg]}
|
||||
rehash()
|
||||
return pkgs
|
||||
|
||||
|
||||
|
@ -148,6 +149,7 @@ def upgrade():
|
|||
# the package is freshly installed
|
||||
pkgs[npkg] = {'old': '',
|
||||
'new': new[npkg]}
|
||||
rehash()
|
||||
return pkgs
|
||||
|
||||
|
||||
|
@ -180,3 +182,17 @@ def purge(name):
|
|||
salt '*' pkg.purge <package name>
|
||||
'''
|
||||
return remove(name)
|
||||
|
||||
def rehash():
|
||||
'''
|
||||
Recomputes internal hash table for the PATH variable.
|
||||
Use whenever a new command is created during the current
|
||||
session.
|
||||
|
||||
CLI Example::
|
||||
|
||||
salt '*' pkg.rehash
|
||||
'''
|
||||
shell = __salt__['cmd.run']('echo $SHELL').split('/')
|
||||
if shell[len(shell)-1] in ["csh","tcsh"]:
|
||||
__salt__['cmd.run']('rehash')
|
||||
|
|
Loading…
Add table
Reference in a new issue