diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-12-12 15:00:55 -0600 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-12-12 15:00:55 -0600 |
commit | 15cf8e55b35c6729b3d0188b8ab839a387834f9c (patch) | |
tree | 821cd02418353280751dfdc81e64fa56a093a730 | |
parent | 9c877ce5588fd778e163d662ca3877ff27e23088 (diff) | |
download | cxmanage-15cf8e55b35c6729b3d0188b8ab839a387834f9c.tar.gz |
CXMAN-121: Raise the default thread count to 48
The cxmanage script was using it's own default of 4, instead of the
default specified in cxmanage_api. Let's just go with the api
default instead.
-rw-r--r-- | cxmanage/__init__.py | 6 | ||||
-rwxr-xr-x | scripts/cxmanage | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/cxmanage/__init__.py b/cxmanage/__init__.py index ac1ec2d..3964ec8 100644 --- a/cxmanage/__init__.py +++ b/cxmanage/__init__.py @@ -122,7 +122,11 @@ def get_nodes(args, tftp, verify_prompt=False): def run_command(args, nodes, name, *method_args): - task_queue = TaskQueue(threads=args.threads, delay=args.command_delay) + if args.threads != None: + task_queue = TaskQueue(threads=args.threads, delay=args.command_delay) + else: + task_queue = TaskQueue(delay=args.command_delay) + tasks = {} for node in nodes: tasks[node] = task_queue.put(getattr(node, name), *method_args) diff --git a/scripts/cxmanage b/scripts/cxmanage index 01c95d7..8017ec2 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -65,8 +65,8 @@ def build_parser(): help='Password for login') parser.add_argument('-a', '--all-nodes', action='store_true', help='Send command to all nodes reported by fabric') - parser.add_argument('--threads', type=int, default=4, - metavar='THREAD_COUNT', help='Number of threads to use') + parser.add_argument('--threads', type=int, metavar='THREAD_COUNT', + help='Number of threads to use') parser.add_argument('--command_delay', type=float, metavar='SECONDS', default=0.0, help='Per thread time to delay between issuing commands') @@ -252,7 +252,7 @@ def build_parser(): def validate_args(args): """ Bail out if the arguments don't make sense""" - if args.threads < 1: + if args.threads != None and args.threads < 1: sys.exit('ERROR: --threads must be at least 1') if args.func == fwupdate_command: if args.skip_simg and args.priority: |