Change node 'image' to 'label'

We are keeping the 'label' terminology in nodepool, and since that
is actually what zuul asks for, use that terminology here to avoid
confusion.

Change-Id: I5f5f1cd041b6dbd80a75af66fe02520f3eb32151
diff --git a/tests/base.py b/tests/base.py
index d8f88b7..93a3a86 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1098,14 +1098,14 @@
         self.jobdir = None
         self.uuid = job.unique
         self.parameters = json.loads(job.arguments)
-        # TODOv3(jeblair): self.node is really "the image of the node
-        # assigned".  We should rename it (self.node_image?) if we
+        # TODOv3(jeblair): self.node is really "the label of the node
+        # assigned".  We should rename it (self.node_label?) if we
         # keep using it like this, or we may end up exposing more of
         # the complexity around multi-node jobs here
-        # (self.nodes[0].image?)
+        # (self.nodes[0].label?)
         self.node = None
         if len(self.parameters.get('nodes')) == 1:
-            self.node = self.parameters['nodes'][0]['image']
+            self.node = self.parameters['nodes'][0]['label']
         self.unique = self.parameters['ZUUL_UUID']
         self.pipeline = self.parameters['ZUUL_PIPELINE']
         self.project = self.parameters['ZUUL_PROJECT']
diff --git a/tests/fixtures/config/ansible/git/common-config/zuul.yaml b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
index 02b87bd..b31c148 100644
--- a/tests/fixtures/config/ansible/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
@@ -71,7 +71,7 @@
     name: check-vars
     nodes:
       - name: ubuntu-xenial
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: hello
diff --git a/tests/fixtures/config/inventory/git/common-config/zuul.yaml b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
index 184bd80..e147b98 100644
--- a/tests/fixtures/config/inventory/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
@@ -16,11 +16,11 @@
     name: nodeset1
     nodes:
       - name: controller
-        image: controller-image
+        label: controller-label
       - name: compute1
-        image: compute-image
+        label: compute-label
       - name: compute2
-        image: compute-image
+        label: compute-label
     groups:
       - name: ceph-osd
         nodes:
@@ -35,7 +35,7 @@
     name: single-inventory
     nodes:
       - name: ubuntu-xenial
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: group-inventory
diff --git a/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml b/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
index ec9c6dd..362434e 100644
--- a/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
@@ -15,4 +15,4 @@
     name: python27
     nodes:
       - name: controller
-        image: ubuntu-trusty
+        label: ubuntu-trusty
diff --git a/tests/fixtures/config/multi-tenant/git/tenant-one-config/zuul.yaml b/tests/fixtures/config/multi-tenant/git/tenant-one-config/zuul.yaml
index 63a19e2..347bc53 100644
--- a/tests/fixtures/config/multi-tenant/git/tenant-one-config/zuul.yaml
+++ b/tests/fixtures/config/multi-tenant/git/tenant-one-config/zuul.yaml
@@ -23,7 +23,7 @@
     name: nodeset1
     nodes:
       - name: controller
-        image: controller-image
+        label: controller-label
 
 - job:
     name: project1-test1
diff --git a/tests/fixtures/config/multi-tenant/git/tenant-two-config/zuul.yaml b/tests/fixtures/config/multi-tenant/git/tenant-two-config/zuul.yaml
index 4feb9f5..5ea803e 100644
--- a/tests/fixtures/config/multi-tenant/git/tenant-two-config/zuul.yaml
+++ b/tests/fixtures/config/multi-tenant/git/tenant-two-config/zuul.yaml
@@ -23,7 +23,7 @@
     name: nodeset1
     nodes:
       - name: controller
-        image: controller-image
+        label: controller-label
 
 - job:
     name: project2-test1
diff --git a/tests/fixtures/config/openstack/git/project-config/zuul.yaml b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
index aff2046..2ad600c 100644
--- a/tests/fixtures/config/openstack/git/project-config/zuul.yaml
+++ b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
@@ -38,7 +38,7 @@
     timeout: 30
     nodes:
       - name: controller
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: python27
@@ -50,7 +50,7 @@
     branches: stable/mitaka
     nodes:
       - name: controller
-        image: ubuntu-trusty
+        label: ubuntu-trusty
 
 - job:
     name: python35
diff --git a/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml b/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
index 2bb61ee..27454d3 100644
--- a/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
@@ -49,20 +49,20 @@
     attempts: 4
     nodes:
       - name: controller
-        image: image1
+        label: label1
 
 - job:
     name: project-test1
     branches: stable
     nodes:
       - name: controller
-        image: image2
+        label: label2
 
 - job:
     name: project-post
     nodes:
       - name: static
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: project-test2
diff --git a/tests/fixtures/layouts/disable_at.yaml b/tests/fixtures/layouts/disable_at.yaml
index 2956ebf..8e352d8 100644
--- a/tests/fixtures/layouts/disable_at.yaml
+++ b/tests/fixtures/layouts/disable_at.yaml
@@ -19,7 +19,7 @@
     name: project-test1
     nodes:
       - name: controller
-        image: image1
+        label: label1
 
 - project:
     name: org/project
diff --git a/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml b/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
index aee5ac6..6a05fe6 100644
--- a/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
+++ b/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
@@ -11,7 +11,7 @@
     name: project-post
     nodes:
       - name: static
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - project:
     name: org/project
diff --git a/tests/fixtures/layouts/idle.yaml b/tests/fixtures/layouts/idle.yaml
index ff33842..60f8ed1 100644
--- a/tests/fixtures/layouts/idle.yaml
+++ b/tests/fixtures/layouts/idle.yaml
@@ -9,13 +9,13 @@
     name: project-bitrot-stable-old
     nodes:
       - name: static
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: project-bitrot-stable-older
     nodes:
       - name: static
-        image: ubuntu-trusty
+        label: ubuntu-trusty
 
 - project:
     name: org/project
diff --git a/tests/fixtures/layouts/no-timer.yaml b/tests/fixtures/layouts/no-timer.yaml
index c8ced62..12eaa35 100644
--- a/tests/fixtures/layouts/no-timer.yaml
+++ b/tests/fixtures/layouts/no-timer.yaml
@@ -27,13 +27,13 @@
     name: project-bitrot-stable-old
     nodes:
       - name: static
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: project-bitrot-stable-older
     nodes:
       - name: static
-        image: ubuntu-trusty
+        label: ubuntu-trusty
 
 - project:
     name: org/project
diff --git a/tests/fixtures/layouts/repo-deleted.yaml b/tests/fixtures/layouts/repo-deleted.yaml
index a33da77..95d11bb 100644
--- a/tests/fixtures/layouts/repo-deleted.yaml
+++ b/tests/fixtures/layouts/repo-deleted.yaml
@@ -40,14 +40,14 @@
     name: project-test1
     nodes:
       - name: controller
-        image: image1
+        label: label1
 
 - job:
     name: project-test1
     branches: stable
     nodes:
       - name: controller
-        image: image2
+        label: label2
 
 - job:
     name: project-test2
diff --git a/tests/fixtures/layouts/smtp.yaml b/tests/fixtures/layouts/smtp.yaml
index 8f53d02..fd91d36 100644
--- a/tests/fixtures/layouts/smtp.yaml
+++ b/tests/fixtures/layouts/smtp.yaml
@@ -46,14 +46,14 @@
     name: project-test1
     nodes:
       - name: controller
-        image: image1
+        label: label1
 
 - job:
     name: project-test1
     branches: stable
     nodes:
       - name: controller
-        image: image2
+        label: label2
 
 - job:
     name: project-test2
diff --git a/tests/fixtures/layouts/timer.yaml b/tests/fixtures/layouts/timer.yaml
index 95199e7..883c32e 100644
--- a/tests/fixtures/layouts/timer.yaml
+++ b/tests/fixtures/layouts/timer.yaml
@@ -28,13 +28,13 @@
     name: project-bitrot-stable-old
     nodes:
       - name: static
-        image: ubuntu-xenial
+        label: ubuntu-xenial
 
 - job:
     name: project-bitrot-stable-older
     nodes:
       - name: static
-        image: ubuntu-trusty
+        label: ubuntu-trusty
 
 - project:
     name: org/project
diff --git a/tests/unit/test_model.py b/tests/unit/test_model.py
index e7e53c4..7a4d53e 100644
--- a/tests/unit/test_model.py
+++ b/tests/unit/test_model.py
@@ -186,7 +186,7 @@
             'post-run': 'base-post',
             'nodes': [{
                 'name': 'controller',
-                'image': 'base',
+                'label': 'base',
             }],
         })
         layout.addJob(base)
@@ -199,7 +199,7 @@
             'post-run': 'py27-post',
             'nodes': [{
                 'name': 'controller',
-                'image': 'new',
+                'label': 'new',
             }],
             'timeout': 40,
         })
@@ -216,7 +216,7 @@
             'post-run': 'py27-diablo-post',
             'nodes': [{
                 'name': 'controller',
-                'image': 'old',
+                'label': 'old',
             }],
             'timeout': 50,
         })
@@ -264,7 +264,7 @@
         self.assertEqual(job.timeout, 40)
         nodes = job.nodeset.getNodes()
         self.assertEqual(len(nodes), 1)
-        self.assertEqual(nodes[0].image, 'new')
+        self.assertEqual(nodes[0].label, 'new')
         self.assertEqual([x.path for x in job.pre_run],
                          ['playbooks/base-pre',
                           'playbooks/py27-pre'])
@@ -292,7 +292,7 @@
         self.assertEqual(job.timeout, 50)
         nodes = job.nodeset.getNodes()
         self.assertEqual(len(nodes), 1)
-        self.assertEqual(nodes[0].image, 'old')
+        self.assertEqual(nodes[0].label, 'old')
         self.assertEqual([x.path for x in job.pre_run],
                          ['playbooks/base-pre',
                           'playbooks/py27-pre',
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index 0ac42c1..d420042 100755
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -59,7 +59,7 @@
         self.assertEqual(A.data['status'], 'MERGED')
         self.assertEqual(A.reported, 2)
         self.assertEqual(self.getJobFromHistory('project-test1').node,
-                         'image1')
+                         'label1')
         self.assertIsNone(self.getJobFromHistory('project-test2').node)
 
         # TODOv3(jeblair): we may want to report stats by tenant (also?).
@@ -109,7 +109,7 @@
         self.assertIn('gate', A.messages[1],
                       "A should transit gate")
         self.assertEqual(self.getJobFromHistory('project-test1').node,
-                         'image2')
+                         'label2')
 
     def test_parallel_changes(self):
         "Test that changes are tested in parallel and merged in series"
diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py
index d15189d..0763dd0 100644
--- a/tests/unit/test_v3.py
+++ b/tests/unit/test_v3.py
@@ -375,9 +375,9 @@
                 name: duplicate
                 nodes:
                   - name: compute
-                    image: foo
+                    label: foo
                   - name: compute
-                    image: foo
+                    label: foo
             """)
 
         file_dict = {'.zuul.yaml': in_repo_conf}
@@ -400,7 +400,7 @@
                 name: duplicate
                 nodes:
                   - name: compute
-                    image: foo
+                    label: foo
                 groups:
                   - name: group
                     nodes: compute