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

modules.event.send(): Prevent backtrace for masterless Minions #35411

Merged

Conversation

eliasp
Copy link
Contributor

@eliasp eliasp commented Aug 12, 2016

What does this PR do?

It prevents a backtrace in modules.event.send() when running a masterless Minion with file_client: local in a config file, but not using --local on the CLI:

# salt-call state.single event.send name=notify/me 
[INFO    ] Loading fresh modules for state activity
[INFO    ] Running state [notify/me] at time 12:30:10.413538
[INFO    ] Executing state event.send for notify/me
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1703, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1649, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/states/event.py", line 53, in send
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/modules/event.py", line 220, in send
    return fire_master(data_dict, tag, preload=preload)
  File "/usr/lib/python2.7/dist-packages/salt/modules/event.py", line 67, in fire_master
    auth = salt.crypt.SAuth(__opts__)
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 944, in __new__
    new_auth.__singleton_init__(opts)
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 982, in __singleton_init__
    self.get_keys()
  File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 611, in get_keys
    salt.utils.verify.check_path_traversal(self.opts['pki_dir'], user)
  File "/usr/lib/python2.7/dist-packages/salt/utils/verify.py", line 403, in check_path_traversal
    raise SaltClientError(msg)
SaltClientError: Could not access /etc/salt/pki. Path does not exist.

[INFO    ] Completed state [notify/me] at time 12:30:10.417082 duration_in_ms=3.544
local:
----------
          ID: notify/me
    Function: event.send
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1703, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1649, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/states/event.py", line 53, in send
                  **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/modules/event.py", line 220, in send
                  return fire_master(data_dict, tag, preload=preload)
                File "/usr/lib/python2.7/dist-packages/salt/modules/event.py", line 67, in fire_master
                  auth = salt.crypt.SAuth(__opts__)
                File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 944, in __new__
                  new_auth.__singleton_init__(opts)
                File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 982, in __singleton_init__
                  self.get_keys()
                File "/usr/lib/python2.7/dist-packages/salt/crypt.py", line 611, in get_keys
                  salt.utils.verify.check_path_traversal(self.opts['pki_dir'], user)
                File "/usr/lib/python2.7/dist-packages/salt/utils/verify.py", line 403, in check_path_traversal
                  raise SaltClientError(msg)
              SaltClientError: Could not access /etc/salt/pki. Path does not exist.
     Started: 12:30:10.413538
    Duration: 3.544 ms
     Changes:   

Summary for local
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1

What issues does this PR fix or reference?

None

Tests written?

No

@cachedout cachedout merged commit 4dc776f into saltstack:2016.3 Aug 12, 2016
@eliasp eliasp deleted the 2016.3-modules.event-handle-file_client-opt branch August 12, 2016 14:59
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

2 participants