-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Extension modules not available through the salt.cmd runner #41024
Comments
Have you run I can't think of a reason that it wouldn't have loaded unless they aren't synced. The minion_mods is used to load them in the salt.cmd runner module, which does use _module_dirs, and loads all the extmod locations on the master. Thanks, |
Yes, @gtmanfred I did run: $ sudo salt-run saltutil.sync_modules
- modules.capirca_acl
- modules.napalm_acl
- modules.napalm_bgp
- modules.napalm_cfnet However, the request still fails: $ sudo salt-run salt.cmd transit.ping
Exception occurred in runner salt.cmd: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/client/mixins.py", line 395, in _low
data['return'] = self.functions[fun](*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/runners/salt.py", line 67, in cmd
utils=utils(__opts__)).get(fun)(*args, **kws)
TypeError: 'NoneType' object is not callable |
Hrm, that is odd, gimme a bit and I will try and replicate this on my end. Thanks, |
I am able to replicate the error, but as soon as I sync modules it works.
|
Did you try with a proxy minion by any chance @gtmanfred? It may be related -- the proxy minions seem to have a very bizarre behaviour when it comes to extension modules caching. |
salt-run is meant to be run on the master? Also, i don't see If you move it to salt://_modules and sync it down does the error go away? I am wondering now if this is just a problem with the Thanks, |
I think it was already cached. For example, if I run it right now, the output is:
It is under salt://_modules, synced and available to run on the CLI. Applying a change inside the module and resync:
This is the virtualname: __virtualname__ = 'transit' However, the def __virtual__():
if HAS_NAPALM and 'proxy' in __opts__:
return __virtualname__
else:
return False Which made the module unavailable as the proxy key does not exist on the master, but only on the proxy minion level. After changing the def __virtual__():
if HAS_NAPALM:
return __virtualname__
else:
return False I am able to run I am happy to close this ticket, but do you think there's any workaround, as there are many modules testing against the proxy key inside the Thanks, |
So, the I think we could possibly add another dunder variable that says to only load modules if the minion is a proxy minion. @cro do you have an opinion about this? Thanks, |
My current opinion is to deprecate the I think I'd prefer to get rid of |
In principle any sounds equally good to me, perhaps The problem in that case was that my module was not available on the master. What would be the behaviour in that case? When |
I think that the problem is that proxyonly would only load if salt.utils.is_proxy returns True which would be false for the master. What we could do is create something that uses the raw_mod from the loader, and ignores https://docs.saltstack.com/en/latest/ref/clients/#salt.loader.raw_mod And expose that in the salt runner. |
Forgot to reply here. |
Yeah, i don't think that is too crazy, @cro do you have any opinion about
this?
…On Mon, May 22, 2017 at 1:47 AM, Mircea Ulinic ***@***.***> wrote:
Forgot to reply here.
This sounds good to me, but it may not work well with modules requiring a
third party lib.
There aren't so many modules though and check 'proxy' in __opts__ or
__opts__['__role'] == 'master' for those that make sense (for some of
them it wouldn't make sense).
What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41024 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAssoXC38P9dx9q56ilqbdrvA67sDBWTks5r8T2OgaJpZM4NPUoo>
.
|
As this makes sense to everyone involved in this thread, I am going to close this issue. Thanks, @gtmanfred @cro |
Description of Issue/Question
Using the
salt.cmd
runner, one is able to execute commands that do not depend necessarily on a certain minion, e.g.http.query
etc.:But with an extension module, it doesn't:
Although the execution module is available:
(edge01.bjm01 is a proxy minion).
I am running 2016.11.4:
The text was updated successfully, but these errors were encountered: