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

network_settings beacon: Update example to follow new cfg convention #47725

Merged
merged 4 commits into from Jun 1, 2018

Conversation

Projects
None yet
3 participants
@bbczeuz
Contributor

bbczeuz commented May 18, 2018

What does this PR do?

With 2018.3, the beacon cfg changed to a list. Simultaneously, the type of the interfaces section of the network_settings beacon changed from list to dict. This PR reflects this change in an updated example and extra handler that catches the outdated cfg syntax

What issues does this PR fix or reference?

none, it simply didn't work.

Previous Behavior

Using the original example (https://docs.saltstack.com/en/latest/ref/beacons/all/salt.beacons.network_settings.html#module-salt.beacons.network_settings):

beacons:
  network_settings:
    - interfaces:
        - eth0:
            ipaddr:
            promiscuity:
              onvalue: 1
        - eth1:
            linkmode:

Results in:

2018-05-18 16:23:05,601 [salt.minion      :2486][CRITICAL][4538] The beacon errored: 
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 2484, in handle_beacons
    beacons = self.process_beacons(self.functions)
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 444, in process_beacons
    return self.beacons.process(b_conf, self.opts['grains'])  # pylint: disable=no-member
  File "/usr/lib/python2.7/dist-packages/salt/beacons/__init__.py", line 104, in process
    valid, vcomment = self.beacons[validate_str](b_config[mod])
  File "/usr/lib/python2.7/dist-packages/salt/beacons/network_settings.py", line 64, in validate
    if not isinstance(_config['interfaces'][item], dict):
TypeError: list indices must be integers, not dict

New Behavior

The original example from above now shows:

2018-05-18 17:28:32,724 [salt.beacons     :108 ][INFO    ][6975] Beacon network_settings configuration invalid, not running.
interfaces section for network_settings beacon must be a dictionary.

With the updated example, the beacon works as expected :)

Tests written?

No

Commits signed with GPG?

No

@rallytime rallytime requested a review from garethgreenaway May 25, 2018

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jun 1, 2018

Hey @bbczeuz - It looks like this change is causing the following test to fail:

  • unit.beacons.test_btmp_beacon.BTMPBeaconTestCase.test_match_time

https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu14-n/23356/

Can you take a look?

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jun 1, 2018

Actually, my apologies @bbczeuz. It appears that test is also failing on the branch. Thanks for fixing this!

@rallytime rallytime merged commit 7c974f8 into saltstack:develop Jun 1, 2018

4 of 10 checks passed

jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #5422 — ABORTED
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #10395 — ABORTED
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #19478 — ABORTED
Details
codeclimate 3 issues to fix
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #23356 — FAILURE
Details
default Build started sha1 is merged.
Details
WIP ready for review
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #25619 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #17690 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #22320 — SUCCESS
Details

rallytime added a commit that referenced this pull request Jun 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment