Skip to content

Commit d9cd91e

Browse files
ilumsdengrondo
authored andcommitted
cli: add -B,--bank= option to flux submission commands
Problem: Users are forced to use --setattr=bank=BANK to set a bank attribute in their jobspec, but this is an attribute documented in RFC 14 and is commonly required in production system instance usage. Add a `-B,--bank=` to all flux submission cli commands to make use of banks more user friendly.
1 parent 58becf5 commit d9cd91e

File tree

1 file changed

+10
-1
lines changed
  • src/bindings/python/flux/cli

1 file changed

+10
-1
lines changed

src/bindings/python/flux/cli/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,13 @@ def create_parser(
757757
description=description,
758758
formatter_class=flux.util.help_formatter(),
759759
)
760+
parser.add_argument(
761+
"-B",
762+
"--bank",
763+
type=str,
764+
metavar="BANK",
765+
help="Submit a job to a specific named bank",
766+
)
760767
parser.add_argument(
761768
"-q",
762769
"--queue",
@@ -1042,6 +1049,9 @@ def jobspec_create(self, args):
10421049
if args.queue is not None:
10431050
jobspec.setattr("system.queue", args.queue)
10441051

1052+
if args.bank is not None:
1053+
jobspec.setattr("system.bank", args.bank)
1054+
10451055
if args.setattr is not None:
10461056
for keyval in args.setattr:
10471057
key, val = parse_jobspec_keyval("--setattr", keyval)
@@ -1425,7 +1435,6 @@ def _progress_check(self, args):
14251435
args.progress = None
14261436

14271437
def watcher_start(self, args):
1428-
14291438
if not self.watcher:
14301439
# Need to open self.flux_handle if it isn't already in order
14311440
# to start the watcher

0 commit comments

Comments
 (0)