All cros flash related codes and functions are put in chromite/lib/auto_updater.py. Different caller may call different sets of functions. There exist several ways of re-org the behaviors.
Richard's suggestion:
Ideally, there'd
be just one set of checks here, and we'd be adding in the new checks
to be made even for the non-Provision `cros flash` code flows. f it's
not reasonable for the new checks to be used in all `cros flash` use
cases, then it would probably be reasonable to go with one of two
other options:
1) At construction time, pass in one or more option flags indicating which update checks are needed.
2) Have the callers check option flags, and choose what checks to call.
Before any discussions, I tend to move checks into the FlashUpdater class like Richard suggested, but preserve some classes to distinguish different behaviors, like called from provision, or call from desktop cros-flash.
Comment 1 by xixuan@chromium.org
, Dec 9 2016