Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saltuitl.sync_modules is not a sync it is a copy #7691

Closed
torhve opened this issue Oct 9, 2013 · 9 comments
Closed

saltuitl.sync_modules is not a sync it is a copy #7691

torhve opened this issue Oct 9, 2013 · 9 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists

Comments

@torhve
Copy link
Contributor

torhve commented Oct 9, 2013

I tried running sync_modules to get rid of an old module that I had used to override a salt module using the same name. The saltutil.sync_modules command happily syncs changes in existing files and new files, however it does not delete files that should not be there.

In my opinion, either the documentation should mention this, since a sync would mean to bring the directory exactly in line with what the salt fileserver has in that directory, or preferrably the sync operation should actually delete old/missing files.

@holmboe
Copy link
Contributor

holmboe commented Oct 9, 2013

I concur. And if sync_modules does not handle removal of modules then there should be another function to delete them. I have resorted to manually deleting files in the filesystem which is a bit cumbersome.

@basepi
Copy link
Contributor

basepi commented Oct 9, 2013

Thanks for pointing this out. Unloading modules is currently not very well-supported, and we need to implement it.

@cachedout
Copy link
Contributor

Adjusted the docs.

@basepi Should we perhaps rename this issue and file it as a feature to delete stale modules for the Hydrogen release?

@thatch45
Copy link
Member

When I originally wrote sync_modules it would delete the old ones, or at least I remember it doing so....

@cachedout
Copy link
Contributor

...researching...

@cachedout
Copy link
Contributor

@thatch45 is right. This code definitely exists. I will test it post-haste to ensure it's still working.

@ghost ghost assigned cachedout Oct 15, 2013
@cachedout
Copy link
Contributor

An update on this.

I spent some amount of time diving into this issue yesterday. In my testing, the sync process did correctly delete the modules on the remote filesystem. However, the modules were not being unloaded from the list of minion functions stored in salt even after saltutil.refresh_modules was run and the correct events were fired and picked up on the minion.

Further complicating this issue is the fact that running salt-call sys.list_modules on the minion does report that the module has been unloaded. It's only from the view of the master that the module does not appear to be unloaded.

We'll keep looking at this issue.

cachedout pushed a commit to cachedout/salt that referenced this issue Nov 4, 2013
This change no longer blindly updates the __salt__ dict for each module upon module refresh but instead rebuilds the dictionary from scratch. Refs saltstack#7691.
@cachedout
Copy link
Contributor

I need @thatch45 to review the above change before it gets merged in but it's addressed the module unloading bug thus far in my testing.

thatch45 added a commit that referenced this issue Nov 6, 2013
Fix bug preventing minions from unloading custom modules.
@cachedout
Copy link
Contributor

The above PR should resolve the issue. If for some reason this is not the case, please feel free to comment and we'll happily re-open it.

cachedout pushed a commit that referenced this issue Nov 8, 2013
This change no longer blindly updates the __salt__ dict for each module upon module refresh but instead rebuilds the dictionary from scratch. Refs #7691.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

5 participants