OLD | NEW |
---|---|
1 # | 1 # |
2 # Copyright 2008 Google Inc. All Rights Reserved. | 2 # Copyright 2008 Google Inc. All Rights Reserved. |
3 | 3 |
4 """ | 4 """ |
5 The job module contains the objects and methods used to | 5 The job module contains the objects and methods used to |
6 manage jobs in Autotest. | 6 manage jobs in Autotest. |
7 | 7 |
8 The valid actions are: | 8 The valid actions are: |
9 list: lists job(s) | 9 list: lists job(s) |
10 create: create a job | 10 create: create a job |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
602 | 602 |
603 def execute(self): | 603 def execute(self): |
604 clone_info = self.execute_rpc(op='get_info_for_clone', | 604 clone_info = self.execute_rpc(op='get_info_for_clone', |
605 id=self.clone_id, | 605 id=self.clone_id, |
606 preserve_metahosts=self.reuse_hosts) | 606 preserve_metahosts=self.reuse_hosts) |
607 | 607 |
608 # Remove fields from clone data that cannot be reused | 608 # Remove fields from clone data that cannot be reused |
609 for field in ('name', 'created_on', 'id', 'owner'): | 609 for field in ('name', 'created_on', 'id', 'owner'): |
610 del clone_info['job'][field] | 610 del clone_info['job'][field] |
611 | 611 |
612 # Also remove parameterized_job field, as the feature still is | |
613 # incomplete, this tool does not attempt to support it for now, | |
614 # it uses a different API function and it breaks create_job() | |
DaleCurtis
2011/02/03 18:07:32
Will this effect Paul's changes?
ericli
2011/02/03 19:18:35
my understanding this will only affect atest job c
| |
615 if clone_info['job'].has_key('parameterized_job'): | |
616 del clone_info['job']['parameterized_job'] | |
617 | |
612 # Keyword args cannot be unicode strings | 618 # Keyword args cannot be unicode strings |
613 self.data.update((str(key), val) | 619 self.data.update((str(key), val) |
614 for key, val in clone_info['job'].iteritems()) | 620 for key, val in clone_info['job'].iteritems()) |
615 | 621 |
616 if self.reuse_hosts: | 622 if self.reuse_hosts: |
617 # Convert host list from clone info that can be used for job_create | 623 # Convert host list from clone info that can be used for job_create |
618 for label, qty in clone_info['meta_host_counts'].iteritems(): | 624 for label, qty in clone_info['meta_host_counts'].iteritems(): |
619 self.data['meta_hosts'].extend([label]*qty) | 625 self.data['meta_hosts'].extend([label]*qty) |
620 | 626 |
621 self.data['hosts'].extend(host['hostname'] | 627 self.data['hosts'].extend(host['hostname'] |
(...skipping 15 matching lines...) Expand all Loading... | |
637 | 643 |
638 | 644 |
639 def execute(self): | 645 def execute(self): |
640 data = {'job__id__in': self.jobids} | 646 data = {'job__id__in': self.jobids} |
641 self.execute_rpc(op='abort_host_queue_entries', **data) | 647 self.execute_rpc(op='abort_host_queue_entries', **data) |
642 print 'Aborting jobs: %s' % ', '.join(self.jobids) | 648 print 'Aborting jobs: %s' % ', '.join(self.jobids) |
643 | 649 |
644 | 650 |
645 def get_items(self): | 651 def get_items(self): |
646 return self.jobids | 652 return self.jobids |
OLD | NEW |