def METHOD_NAME(self, duration, endtime):
    # Can flake with "[ERROR]:-End time occurs in the past"
    # if duration is set too low.
    if endtime:
        newtime = datetime.now() + timedelta(seconds=2)
        flags = " --end \"%s\"" % newtime.strftime("%Y-%m-%d %H:%M:%S")
    elif duration:
        flags = " --duration %s" % duration
    else:
        flags = ""
    rc, stderr, stdout = run_gpcommand(self.context, "gpexpand %s" % (flags))
    if rc == 0:
        rc = self.get_redistribute_status()
    return (rc, stderr, stdout)