acloud: fix py3 compatible issue: TypeError: cannot use a bytes pattern on a string-like object
import six.b can work both py2 and py3.
BUG: 137195528
BUG: 145566087
Test: acloud-dev create
acloud-dev create --local-image
acloud-dev create --local-instance -y
acloud-dev create --local-instance --local-image -y
acloud-dev setup
Change-Id: I3acd3766d1036d2dad9971acfb7b355641fbc8fb
diff --git a/setup/setup_common_test.py b/setup/setup_common_test.py
index 5a00cfc..e17e529 100644
--- a/setup/setup_common_test.py
+++ b/setup/setup_common_test.py
@@ -14,6 +14,7 @@
"""Tests for host_setup_runner."""
import subprocess
import unittest
+from six import b
from acloud import errors
from acloud.internal.lib import driver_test_lib
@@ -22,21 +23,21 @@
class SetupCommonTest(driver_test_lib.BaseDriverTest):
"""Test HostPkgTaskRunner."""
- PKG_INFO_INSTALLED = """fake_pkg:
+ PKG_INFO_INSTALLED = b("""fake_pkg:
Installed: 0.7
Candidate: 0.7
Version table:
-"""
- PKG_INFO_NONE_INSTALL = """fake_pkg:
+""")
+ PKG_INFO_NONE_INSTALL = b("""fake_pkg:
Installed: (none)
Candidate: 0.7
Version table:
-"""
- PKG_INFO_OLD_VERSION = """fake_pkg:
+""")
+ PKG_INFO_OLD_VERSION = b("""fake_pkg:
Installed: 0.2
Candidate: 0.7
Version table:
-"""
+""")
# pylint: disable=invalid-name
def testPackageNotInstalled(self):