Fixes test_device_tagging IndexError

If the metadata_service config option is set to True, the test
test_device_tagging will connect to the spawned instance through ssh
and curl the metadata service and checks the response for the assigned
device tags.

However, not all devices are tagged, causing an IndexError. This patch
solves this issue.

Libvirt only exposes tagged devices, but other drivers (Hyper-V) can
expose other devices as well.

Change-Id: I7570cd81eec09109ad5c74315a7876f53c032240
Closes-Bug: #1747872
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index d857fcb..d3b1350 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -82,7 +82,9 @@
             # A hypervisor may present multiple paths to a tagged disk, so
             # there may be duplicated tags in the metadata, use set() to
             # remove duplicated tags.
-            found_devices = [d['tags'][0] for d in md_dict['devices']]
+            # Some hypervisors might report devices with no tags as well.
+            found_devices = [d['tags'][0] for d in md_dict['devices']
+                             if d.get('tags')]
             self.assertEqual(set(found_devices), set(['port-1', 'port-2',
                                                       'net-1', 'net-2-100',
                                                       'net-2-200', 'boot',