PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/status.py

"""
This thorium state is used to track the status beacon events and keep track of
the active status of minions

.. versionadded:: 2016.11.0
"""

import fnmatch
import time


def reg(name):
    """
    Activate this register to turn on a minion status tracking register, this
    register keeps the current status beacon data and the time that each beacon
    was last checked in.
    """
    ret = {"name": name, "changes": {}, "comment": "", "result": True}
    now = time.time()
    if "status" not in __reg__:
        __reg__["status"] = {}
        __reg__["status"]["val"] = {}
    for event in __events__:
        if fnmatch.fnmatch(event["tag"], "salt/beacon/*/status/*"):
            # Got one!
            idata = {"recv_time": now}
            for key in event["data"]["data"]:
                if key in ("id", "recv_time"):
                    continue
                idata[key] = event["data"]["data"][key]
            __reg__["status"]["val"][event["data"]["id"]] = idata
            ret["changes"][event["data"]["id"]] = True
    return ret