Commit Graph

45075 Commits

Author SHA1 Message Date
Thomas Jackson
438ede78ba Support arbitrarily deep modules
Note: salt can still only *call* modules on the first depth, but they can then import anything below
2015-02-07 14:55:30 -08:00
Thomas Jackson
249096c292 Change modulekey for submodule test-- to avoid namespace collisions 2015-02-07 12:02:26 -08:00
Thomas Jackson
7605ba60a8 pylint 2015-02-07 12:02:26 -08:00
Thomas Jackson
ca5eac3936 Add support for submodules to LazyLoader
This was a feature that was inadvertently removed in #20274, but since it was undocumented and untested no one noticed. Thanks to @steverweber for pointing it out.

This includes the feature as well as tests.
2015-02-07 12:02:26 -08:00
Thomas Jackson
725708a04b Correct tag name in loader tests 2015-02-07 12:02:23 -08:00
Thomas Jackson
bb89068010 Add "disabled" support
this allows you to "blacklist" modules.

Addition to #20274

Conflicts:
	salt/loader.py
2015-02-07 12:02:03 -08:00
rallytime
15a140ece4 Moved tests/unit/loader.py to tests/integration/loader/loader.py
These are integration tests and not unit tests, so they should be
in the proper directory.

Also, fixed up the python 3 incompatability pylint errors.
2015-02-07 11:59:47 -08:00
Thomas Jackson
fb0d46f445 Pylint 2015-02-07 11:59:03 -08:00
Thomas Jackson
368e5a8e92 Add test for __func__alias__ 2015-02-07 11:59:03 -08:00
Thomas Jackson
5ba53611c4 Remove some old unused code 2015-02-07 11:59:03 -08:00
Thomas Jackson
9ee188dd90 More loader tests
As well as an optimization on clear()
2015-02-07 11:59:01 -08:00
Thomas Jackson
fe2d141081 Add loader tests 2015-02-07 11:59:00 -08:00
Thomas Jackson
3348820058 Since clear() removes all modules, reloads are unecessary 2015-02-07 11:59:00 -08:00
Thomas Jackson
f7da6364ff Minor performance improvement 2015-02-07 11:59:00 -08:00
Thomas Jackson
1772a280f4 If you have the module loaded, lets not require another hit to disk 2015-02-07 11:59:00 -08:00
Thomas Jackson
726f8dc2ac Check that __context__ is always present, since it now is (properly) 2015-02-07 11:59:00 -08:00
Thomas Jackson
728e33a136 remove old deprecated mechanism 2015-02-07 11:58:56 -08:00
Thomas Jackson
3e9f9100e3 Fix process_virtual error_reasons
Never used, so I fixed it up to not be a list-- since you can only have one. We will also log this as an error, for now since the module is asking for an error
2015-02-07 11:58:56 -08:00
Thomas Jackson
8a1ef674ab Misc cleanup 2015-02-07 11:58:56 -08:00
Thomas Jackson
d539380266 Cleanup FunctionWrapper 2015-02-07 11:58:56 -08:00
Thomas Jackson
e55919b0d1 Remove unecessary format, a string is always a string 2015-02-07 11:58:53 -08:00
Thomas Jackson
69f3f3dd0f Move "pack" over to a dict
Since it doesn't make sense to allow for duplicate "name" pack items, we should just use a dict. This also makes sharing __context__ between all the plugins *significantly* cleaner
2015-02-07 11:58:50 -08:00
Thomas Jackson
f47df434e3 Inject globals after verifying the function-- because it might not exist!
Conflicts:
	salt/client/mixins.py
2015-02-07 11:58:46 -08:00
Thomas Jackson
a55c155de4 Attempt dict access
Apparently SSH FunctionWraper breaks when you do just the "in" comparator
2015-02-07 11:57:45 -08:00
Thomas Jackson
d1b57764e6 Conditionally inject context (if no one else has) 2015-02-07 11:57:45 -08:00
Thomas Jackson
795fa12415 Remove test as well
Conflicts:

	tests/unit/output/grains.py

Conflicts:
	tests/unit/output/grains.py
2015-02-07 11:57:40 -08:00
Thomas Jackson
e1f8ea650f Remove grains outputter
Its been broken for ~8 months (or more), and its been falling back to nested. Since nested does (IMO) a better job displaying the data and is generic, there is no reason to get this working-- esp since we've already "deprecated" it, by it not working

Conflicts:

	salt/output/grains.py

Conflicts:
	salt/output/grains.py
2015-02-07 11:57:14 -08:00
Thomas Jackson
df4dfc6635 Rename NewLazyLoader to LazyLoader (since the old one was deleted) 2015-02-07 11:55:27 -08:00
Thomas Jackson
55aa213bca Some more cleanup to grains outputter, closer to working
Conflicts:
	salt/output/grains.py
2015-02-07 11:55:23 -08:00
Thomas Jackson
7ee3e592af __salt__ is not a lazydict object, not a dict.
In addition, since _yaml_result_unicode_to_utf8 is recursive, there is no need for the depth under the OrderedDict section
2015-02-07 11:54:49 -08:00
Thomas Jackson
f693ba31ab Rename func, since it overlaps (works because of ordering, but still...) 2015-02-07 11:54:49 -08:00
Thomas Jackson
109ba59165 Pylint 2015-02-07 11:54:44 -08:00
Thomas Jackson
2fa3df97d1 Proper precedence of file extensions 2015-02-07 11:54:44 -08:00
Thomas Jackson
ff18bd2ea9 Make the pyobjects loader ignore virtual (it did before) 2015-02-07 11:54:44 -08:00
Thomas Jackson
1462df65ab Migrate to new loader 2015-02-07 11:54:44 -08:00
Thomas Jackson
c6f6148810 Change default to false, since everyone seems to pass them in 2015-02-07 11:54:44 -08:00
Thomas Jackson
e25b0e533a Make LazyLoader's singleton-ness optional 2015-02-07 11:54:44 -08:00
Thomas Jackson
decd831458 Fix pyobjects renderer to use new loader 2015-02-07 11:54:44 -08:00
Thomas Jackson
1ac61e27af Fix namespacing of modules in dependency dict 2015-02-07 11:54:43 -08:00
Thomas Jackson
34f0f3b8c3 pylint some more 2015-02-07 11:54:43 -08:00
Thomas Jackson
3a499ea778 Pylint fix 2015-02-07 11:54:43 -08:00
Thomas Jackson
b5d2584ce6 Stop caching grains globally in memory.
We can add this later, but we have to determine what conditions go into unique-ing the grains (just mimic disk cache)
2015-02-07 11:54:43 -08:00
Thomas Jackson
9d31b1bcc3 Misc other loader globals fixes 2015-02-07 11:54:43 -08:00
Thomas Jackson
02e219e452 Pack modules to runners 2015-02-07 11:54:39 -08:00
Thomas Jackson
98d361d48c Fix import namespacing 2015-02-07 11:54:38 -08:00
Thomas Jackson
d1215fdc64 Fix call() in loader 2015-02-07 11:54:38 -08:00
Thomas Jackson
a1cfe7e4e2 More pylint fixes 2015-02-07 11:54:38 -08:00
Thomas Jackson
fe915e7d30 whitespace pylint cleanup 2015-02-07 11:54:38 -08:00
Thomas Jackson
ab22997431 Reload submodules after initial load 2015-02-07 11:54:35 -08:00
Thomas Jackson
73cd9434d0 Pass in "kind" to cleanup in depends decorator instead of guessing
Conflicts:
	salt/utils/decorators/__init__.py
2015-02-07 11:54:30 -08:00