diff options
author | George Kraft <george.kraft@calxeda.com> | 2013-04-30 14:12:10 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2013-04-30 14:12:10 -0500 |
commit | 096e8b341a82520e4603d95c806a195089cc709a (patch) | |
tree | bb7371e8aacb36522fe82264e89673d02a4756ea | |
parent | 7daf4f92ee27983c2ca9ce78e2afdcff3b94318f (diff) | |
download | cxmanage-096e8b341a82520e4603d95c806a195089cc709a.tar.gz |
CXMAN-189: fwupdate: Don't reset if ECME version < 1.2.0
Instead, print an error and tell the user to power cycle manually.
-rw-r--r-- | cxmanage/commands/fw.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cxmanage/commands/fw.py b/cxmanage/commands/fw.py index 03fc50a..ea06016 100644 --- a/cxmanage/commands/fw.py +++ b/cxmanage/commands/fw.py @@ -28,6 +28,8 @@ # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. +from pkg_resources import parse_version + from cxmanage import get_tftp, get_nodes, get_node_strings, run_command, \ prompt_yes @@ -61,6 +63,18 @@ def fwupdate_command(args): def do_reset(): """ Reset and wait. Returns True on failure. """ if not args.quiet: + print "Checking ECME versions..." + + results, errors = run_command(args, nodes, "get_versions") + + for result in results.values(): + version = result.ecme_version.lstrip("v") + if parse_version(version) < parse_version("1.2.0"): + print "ERROR: MC reset is unsafe on ECME version v%s" % version + print "Please power cycle the system and start a new fwupdate." + return True + + if not args.quiet: print "Resetting nodes..." results, errors = run_command(args, nodes, "mc_reset", True) |