def METHOD_NAME(args):
    hostname = args.get("hostname")
    usrname = args.get("usrname")
    password = args.get("password")
    if hostname == None:
        print "No hostname"
        return 1
    o = ipmitool("-H", hostname, "-U", usrname, "-P", password, "chassis", "power", "status")
    if o.ret:
        print o.stderr
        return 1
    if "is on" in o.stdout:
        o = ipmitool("-H", hostname, "-U", usrname, "-P", password, "chassis", "power", "cycle")
    else:
        o = ipmitool("-H", hostname, "-U", usrname, "-P", password, "chassis", "power", "reset")
    if o.ret:
        print o.stderr
        return 1
    else:
        return 0