fix vsg and exampleservice tests Get compute node

This commit lookup the compute node according to the VM id.
This make sure that incase of multi compute we will get the
correct compute node name.

Change-Id: If53b421a537874f66079deb8239e434eb04aef42
diff --git a/roles/test-exampleservice/tasks/main.yml b/roles/test-exampleservice/tasks/main.yml
index 08fad6b..60c9f29 100644
--- a/roles/test-exampleservice/tasks/main.yml
+++ b/roles/test-exampleservice/tasks/main.yml
@@ -37,7 +37,7 @@
     - skip_ansible_lint # running a sub job
 
 - name: Get name of compute node
-  shell: bash -c "source ~/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3"
+  shell: bash -c "source ~/admin-openrc.sh; nova show {{ nova_id.stdout }}|grep hypervisor_hostname|cut -d '|' -f 3"
   register: node_name
   tags:
     - skip_ansible_lint # running a sub job
diff --git a/roles/test-vsg/tasks/main.yml b/roles/test-vsg/tasks/main.yml
index 6beb908..4ad76e2 100644
--- a/roles/test-vsg/tasks/main.yml
+++ b/roles/test-vsg/tasks/main.yml
@@ -3,12 +3,6 @@
 #
 # Run tests to check that the CORD-in-a-Box deployment has worked.
 
-- name: Get name of compute node
-  shell: bash -c "source ~/admin-openrc.sh; nova service-list|grep nova-compute|cut -d '|' -f 3"
-  register: node_name
-  tags:
-    - skip_ansible_lint # running a sub job
-
 - name: Wait for vSG VM to come up
   shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null"
   register: result
@@ -30,6 +24,12 @@
   tags:
     - skip_ansible_lint # running a sub job
 
+- name: Get name of compute node
+  shell: bash -c "source ~/admin-openrc.sh; nova show {{ nova_id.stdout }}|grep hypervisor_hostname|cut -d '|' -f 3"
+  register: node_name
+  tags:
+    - skip_ansible_lint # running a sub job
+
 - name: Wait for Docker container inside VM to come up
   shell: ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" ubuntu@{{ mgmt_ip.stdout }} "sudo docker ps|grep vcpe" > /dev/null
   register: result