Skip to content

Commit

Permalink
Merge pull request #93 from forvitinn/last-checkin
Browse files Browse the repository at this point in the history
add last checkin date
  • Loading branch information
grahamgilbert authored Mar 2, 2021
2 parents 25e0b9d + 8d855db commit 0d7ee8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions payload/usr/local/sal/bin/sal-submit
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import requests.exceptions

import sal

from Foundation import NSDate

CHECKIN_MODULES_DIR = "/usr/local/sal/checkin_modules"

Expand Down Expand Up @@ -77,6 +78,7 @@ def main():
response = send_checkin(report)

if response and response.status_code == 200:
sal.set_sal_pref("LastCheckDate", NSDate.new())
sal.clean_results()

# Speed up manual runs by skipping these potentially slow-running,
Expand Down Expand Up @@ -389,3 +391,4 @@ def _payload_cleanse(payload):

if __name__ == "__main__":
main()

4 changes: 0 additions & 4 deletions sal_python_pkg/sal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ def get_hash(file_path):

def add_plugin_results(plugin, data, historical=False):
"""Add data to the shared plugin results plist.
This function creates the shared results plist file if it does not
already exist; otherwise, it adds the entry by appending.
Args:
plugin (str): Name of the plugin returning data.
data (dict): Dictionary of results.
Expand Down Expand Up @@ -73,9 +71,7 @@ def save_results(data):

def set_checkin_results(module_name, data):
"""Set data by name to the shared results JSON file.
Existing data is overwritten.
Args:
module_name (str): Name of the management source returning data.
data (dict): Dictionary of results.
Expand Down

0 comments on commit 0d7ee8c

Please sign in to comment.