macadmins / sashay

DEPRECATED - Scrape caching server logs and send periodic reports
Apache License 2.0
37 stars 2 forks source link

Error when running manually from the CLI #2

Closed flammable closed 8 years ago

flammable commented 9 years ago

Hey Allister -

I'm not sure if you'll have seen the discussion on Slack before this, but @erikng mentioned that this is a bug - I'm posting a GitHub issue so it can be better tracked.

I installed Sashay, ran it manually, and found the report mostly empty - I realized that's because I didn't enable the extra logging. I did that, and added another subnet (as we expanded our testing), and started seeing this error when I ran sashay.py manually:

$ sudo /usr/local/bin/sashay.py
This will be a very spare/boring report if you don't run this command:
                  sudo serveradmin settings caching:LogClientIdentity = 1
Traceback (most recent call last):
  File "/usr/local/bin/sashay.py", line 376, in <module>
    main()
  File "/usr/local/bin/sashay.py", line 318, in main
    (daily_total_from_cache, daily_total_from_apple, peer_amount) = parse_bandwidth(bandwidth_lines_list, server_vers)
  File "/usr/local/bin/sashay.py", line 189, in parse_bandwidth
    peer_amount = 'along with %s from peers' % gen_mb_or_gb(daily_total_from_peers)
UnboundLocalError: local variable 'daily_total_from_peers' referenced before assignment

Any idea what's going on? I haven't hit any of the scheduled times yet, so I imagine that probably doesn't work, either. Let me know if I'm doing anything weird.

Thanks for this! The extra stats will very much help me justify running these servers, so I'm very appreciative that you wrote and published it (and Erik, with Cacher).

Mike

flammable commented 8 years ago

Fixed in 3a1eb161b1123bc27f143297727e2c720df7a62d. Thanks!