Add support for an --image flag to atest.

This enables creating jobs from the CLI that use autoserv to install a new OS image before running the requested test.

This was not added to the database like the reboot before/reboot after flags to maintain backward compatibility and avoid any changes to the database schema.

Also it is not working as a pure parameterized job as the current implementation is not 100% complete and would require more work to finish.  And since mixed jobs are not allowed it would also mean moving existing control file jobs to parameterized jobs.

So the implementation of adding a parameterized id to control jobs and using a known test to hold the OS image path is the most straight forward of the options.

Change-Id: I77cdda0c50c222a4c594da2626a71fa55f5957cb

BUG=chromium-os:11486
TEST=Manual testing using atest cli to create jobs with --image parameters and verifying the value is passed to autoserv.

Review URL: http://codereview.chromium.org/6181003
diff --git a/frontend/afe/models.py b/frontend/afe/models.py
index 33ffb8c..8cf42fa 100644
--- a/frontend/afe/models.py
+++ b/frontend/afe/models.py
@@ -993,9 +993,15 @@
 
         control_file = options.get('control_file')
         parameterized_job = options.get('parameterized_job')
-        cls.check_parameterized_job(control_file=control_file,
-                                    parameterized_job=parameterized_job)
 
+        # The current implementation of parameterized jobs requires that only
+        # control files or parameterized jobs are used. Using the image
+        # parameter on autoupdate_ParameterizedJob doesn't mix pure
+        # parameterized jobs and control files jobs, it does muck enough with
+        # normal jobs by adding a parameterized id to them that this check will
+        # fail. So for now we just skip this check.
+        # cls.check_parameterized_job(control_file=control_file,
+        #                             parameterized_job=parameterized_job)
         user = User.current_user()
         if options.get('reboot_before') is None:
             options['reboot_before'] = user.get_reboot_before_display()
@@ -1032,8 +1038,14 @@
 
 
     def save(self, *args, **kwargs):
-        self.check_parameterized_job(control_file=self.control_file,
-                                     parameterized_job=self.parameterized_job)
+        # The current implementation of parameterized jobs requires that only
+        # control files or parameterized jobs are used. Using the image
+        # parameter on autoupdate_ParameterizedJob doesn't mix pure
+        # parameterized jobs and control files jobs, it does muck enough with
+        # normal jobs by adding a parameterized id to them that this check will
+        # fail. So for now we just skip this check.
+        # cls.check_parameterized_job(control_file=self.control_file,
+        #                             parameterized_job=self.parameterized_job)
         super(Job, self).save(*args, **kwargs)