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

Avoid raising exceptions when calling Fileserver.envs #49388

Closed
wants to merge 1 commit into from

Conversation

dwoz
Copy link
Contributor

@dwoz dwoz commented Aug 29, 2018

What does this PR do?

Fixing the following errors seen in the tests:

2018-08-28 21:13:10,130 [salt.loader      :1710][ERROR   ][5176] Failed to load function {'cmd': '_file_envs.envs because its module ({'cmd': '_file_envs) is not in the whitelist: [u'sseapi', u'roots']

salt.fileserver.Fileserver.envs sanitizes it's batch keyword arg but that is not designed to handle dictionaries. This method get's called from the following line with a dictionary:

https://github.com/saltstack/salt/blob/2018.3.3/salt/master.py#L1788

This load argument is not synonymous with either of the keyword args accepted by salt.fileserver.Fileserver.envs. Adding a proxy method that prevents passing anything to salt.fileserver.Fileserver.envs.

Tests written?

No

Commits signed with GPG?

Yes

@dwoz dwoz requested a review from a team as a code owner August 29, 2018 00:58
@dwoz dwoz changed the title Avoid raising exceptions when calling Fileserver.envs [WIP] Avoid raising exceptions when calling Fileserver.envs Aug 29, 2018
@dwoz dwoz changed the title [WIP] Avoid raising exceptions when calling Fileserver.envs Avoid raising exceptions when calling Fileserver.envs Aug 29, 2018
salt/master.py Outdated

:param dict load: A payload received from a minion (ignored)
'''
return self._fs_file_envs()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a function call, or an attribute?

Copy link
Contributor Author

@dwoz dwoz Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has historically been a function call but with the wrong arguments. Passing no args returns all environments.

Copy link
Contributor

@gtmanfred gtmanfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes discussed on slack.

salt/master.py Outdated
@@ -1276,6 +1276,14 @@ def __verify_load(self, load, verify_keys):

return load

def _file_envs(self, *args):
'''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so this should accept one keyword load and then add a pylint exception to ignore that load is not used.

@gtmanfred
Copy link
Contributor

superseded by #49389

@gtmanfred gtmanfred closed this Aug 29, 2018
@dwoz dwoz deleted the fs_envs branch September 17, 2018 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants