#! /usr/bin/env python

#  We have removed the ability for auto-firmware upgrade from our code.
#  This script should be removed in a future release (or commit)
#  when it is no longer necessary on OneFS upgrades or boots.
#  Until then, simply have the script return 0 all the time:
#  0 == UPDATE_CHECK_NONE_FOUND: No updates found
#  (Ref safe.id.diskctl_defines)
#  See the "Note" at bottom of comments!
#  Retaining original comments below:

# For use with isi update, isi_reimage:
# Check revs, apply updates for FW/etc.
#  o  Light-weight, quiet output available (DEFAULT: False)
#  o  Option to DISABLE confirm prompts (DEFAULT: False, ordinarily prompt)
#  o  Uses common isi_*_check script framework and modules
#  o  Minimal stats gathering - only what's needed

# Q: Do we want to limit the scope of what diskctl is doing?
#    Right now, we just call it... the internals is common.
#    If we wanted to limit to only LSI Disk ctlr + Vit Expander,
#    we'd have to key off mode in ['update'] to limit...
# For now, we'll leave it as-is.

# Q: Do we want to modify the stats log dir at all, since Brian's email
#    mentioned isi_hw_check was too "clunky" with logs?  We'll need at
#    least a temp dir during execution, but if necessary we could clean
#    up and remove this, post-execution.
# For now, we'll leave it as-is.  Note we use /var/log, not /var/crash

# NOTE if we have need for diff prompts for update,reimage, we can use diff
# modes for each (e.g., ['update','reimage']. This may also be useful if we
# need to have each of these "higher layer" utilities behave differently in
# this script/lower guts.

# Based on isi_hw_check; Removed this baggage:
# - skip_identity, safe.id, Id tests
# - hw_info_filename, hw_info, lib.hwinfo, [??? needed]
# - menus: id_in_menu, show_menu, etc
# - modules/tests: enable_*_tests, run_*_tests
# - straggler ramdisk

#
# When called in 'update' mode (Default), it will call down in the standard
# diskctl do_upgrade=True mode, with these differences:
#  o no prompting
#  o auto-reboots will not be done (?? Confirm)
#
# When called in 'check' mode (-c, --check), it will only look for any
# required updates (any mismatching versions).  It will return 
#  == UPDATE_CHECK_NONE_FOUND: No updates found
#  == UPDATE_CHECK_REQD_FOUND: Required updates found
#  == UPDATE_CHECK_ERROR     : Error

import sys

# normal return values (note consistent ERROR with 'check')
SUCCESS                 = 0
# ERROR                   = diskctl.UPDATE_CHECK_ERROR

def main():
    return SUCCESS

#
# Start running here
#
if __name__ == '__main__':
    sys.exit(main())
