forked from M-Labs/artiq
1
0
Fork 0

frontend/client: support keeping persist flag

This commit is contained in:
Sebastien Bourdeauducq 2016-07-03 12:19:46 +08:00
parent fdc25777da
commit cc9edc1555
1 changed files with 12 additions and 1 deletions

View File

@ -81,6 +81,8 @@ def get_argparser():
help="value in PYON format") help="value in PYON format")
parser_set_dataset.add_argument("-p", "--persist", action="store_true", parser_set_dataset.add_argument("-p", "--persist", action="store_true",
help="make the dataset persistent") help="make the dataset persistent")
parser_set_dataset.add_argument("-n", "--no-persist", action="store_true",
help="make the dataset non-persistent")
parser_del_dataset = subparsers.add_parser( parser_del_dataset = subparsers.add_parser(
"del-dataset", help="delete a dataset") "del-dataset", help="delete a dataset")
@ -151,7 +153,16 @@ def _action_delete(remote, args):
def _action_set_dataset(remote, args): def _action_set_dataset(remote, args):
remote.set(args.name, pyon.decode(args.value), args.persist) if args.persist and args.no_persist:
print("Options --persist and --no-persist cannot be specified "
"at the same time")
sys.exit(1)
persist = None
if args.persist:
persist = True
if args.no_persist:
persist = False
remote.set(args.name, pyon.decode(args.value), persist)
def _action_del_dataset(remote, args): def _action_del_dataset(remote, args):