remote_client: Use blkid -L to find config drive by filesystem label
This change avoids the use of the re module to find the device name from
the normal blkid output.
Change-Id: I3c2c344768f6335c918565783da531db62b1bd3b
diff --git a/tempest/lib/common/utils/linux/remote_client.py b/tempest/lib/common/utils/linux/remote_client.py
index 8ac1d38..71fed02 100644
--- a/tempest/lib/common/utils/linux/remote_client.py
+++ b/tempest/lib/common/utils/linux/remote_client.py
@@ -11,7 +11,6 @@
# under the License.
import functools
-import re
import sys
import netaddr
@@ -134,9 +133,8 @@
This method will not unmount the config drive, so unmount_config_drive
must be used for cleanup.
"""
- cmd_blkid = 'blkid | grep -i config-2'
- result = self.exec_command(cmd_blkid)
- dev_name = re.match('([^:]+)', result).group()
+ cmd_blkid = 'blkid -L config-2 -o device'
+ dev_name = self.exec_command(cmd_blkid).strip()
try:
self.exec_command('sudo mount %s /mnt' % dev_name)