saltstack / saltstack/salt

[BUG] beacon disables another beacon

Open
#57,058 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-more-info
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
A clear and concise description of what the bug is.

I have two custom beacon:

  1. is configed via pillar:
beacons:
  beacon1:
    - interval: 120

and read the content of a json file:

import json
import os

__virtualname__ = "beacon1"

def __virtual__():
    if os.path.exists('/path/to/jsonfile'):
        return __virtualname__
    return False

def validate(config):
    '''
    Validate the beacon configuration
    '''
    return True, 'Valid beacon configuration'

def beacon(config):
    '''
    send the content of json
    '''
    with open('/path/to/jsonfile') as f:
        return [json.load(f)]
  1. like the above for another json file but not configed via pillar and is needed to be send on-demand but for every second I can activate this with:
    salt '*' beacons.add beacon2 "{}"

if I delete the pillar the second beacons data comes but when the pillar exists its like the first one prevent the second one from sending data even though the interval for first one is 2 min

Setup

Steps to Reproduce the behavior

Expected behavior

Screenshots

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
           Salt: 2019.2.2
 
Dependency Versions:
           cffi: 0.8.6
       cherrypy: unknown
       dateutil: 2.2
      docker-py: Not Installed
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: 1.2.3
      pycparser: 2.10
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.9 (default, Sep 14 2019, 20:00:08)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.11 
         locale: UTF-8
        machine: x86_64
        release: 3.16.0-4-amd64
         system: Linux
        version: debian 8.11

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two custom Python beacons described in the issue: one configured through the beacons pillar and one added with salt '*' beacons.add beacon2 "{}". Trace how the pillar configuration and on-demand beacons.add command are handled, then verify that both beacon data streams are emitted according to their configured behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.