Include image name and number in job metadata.

Include the name and number of the image that will be used for QA purposes in
the job metadata so that these jobs and their results can be unambiguously
identified in the LAVA database.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
diff --git a/lava-submit.py b/lava-submit.py
index 185759f..2b65c3a 100755
--- a/lava-submit.py
+++ b/lava-submit.py
@@ -54,7 +54,7 @@
         })
     return actions
 
-def get_job(jobname, device_type, img_url, tests):
+def get_job(jobname, device_type, img_url, tests, image_name, image_number):
     stream = '/private/team/linaro/pre-built-%s/' % DEVICE_STREAM[device_type]
 
     job = collections.OrderedDict()
@@ -66,6 +66,10 @@
             'command': "deploy_linaro_image",
             'parameters': {
                 'image': img_url
+            },
+            'metadata': {
+                'ubuntu.name': image_name,
+                'ubuntu.build': image_number
             }
         },
             {
@@ -98,6 +102,10 @@
                    help='The device type to execute on. ie "panda"')
     p.add_argument('-t', dest='image_type', default='nano',
                    help='The image type to execute on, nano (default) or ubuntu-desktop')
+    p.add_argument('-n', dest='image_name', required=True,
+                   help='The name of the image for QA purposes, e.g. "lt-panda-x11-base"')
+    p.add_argument('-c', dest='image_number', required=True,
+                   help='The build number for this image')
     args = p.parse_args()
 
     # test sets specific to images and boards
@@ -126,7 +134,8 @@
         except ValueError:
             pass
 
-    job = get_job(args.job_name, args.device_type, args.img_url, tests)
+    job = get_job(args.job_name, args.device_type, args.img_url, tests,
+                  args.image_name, args.image_number)
 
     user = os.environ.get('LAVA_USER')
     token = os.environ.get('LAVA_TOKEN')