diff options
| author | Chad Smith <chad.smith@canonical.com> | 2018-06-21 14:32:27 -0600 |
|---|---|---|
| committer | Chad Smith <chad.smith@canonical.com> | 2018-06-21 14:32:27 -0600 |
| commit | ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524 (patch) | |
| tree | 5b68f0602daea648d48b3dc16809b0d66fb565d1 /tests/cloud_tests/platforms/lxd/instance.py | |
| parent | 7d1e8976bba629f30da45e814a5a97e2f4b7de3d (diff) | |
| parent | 2d6e4219db73e80c135efd83753f9302f778f08d (diff) | |
| download | vyos-cloud-init-ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524.tar.gz vyos-cloud-init-ba53ceb5a8a30c10951ec3ac49b8d6ebbe09a524.zip | |
merge from master at 18.3
Diffstat (limited to 'tests/cloud_tests/platforms/lxd/instance.py')
| -rw-r--r-- | tests/cloud_tests/platforms/lxd/instance.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/cloud_tests/platforms/lxd/instance.py b/tests/cloud_tests/platforms/lxd/instance.py index 0d957bca..d396519f 100644 --- a/tests/cloud_tests/platforms/lxd/instance.py +++ b/tests/cloud_tests/platforms/lxd/instance.py @@ -152,9 +152,8 @@ class LXDInstance(Instance): return fp.read() try: - stdout, stderr = subp( - ['lxc', 'console', '--show-log', self.name], decode=False) - return stdout + return subp(['lxc', 'console', '--show-log', self.name], + decode=False)[0] except ProcessExecutionError as e: raise PlatformError( "console log", @@ -209,16 +208,15 @@ def _has_proper_console_support(): if 'console' not in info.get('api_extensions', []): reason = "LXD server does not support console api extension" else: - dver = info.get('environment', {}).get('driver_version', "") + dver = str(info.get('environment', {}).get('driver_version', "")) if dver.startswith("2.") or dver.startswith("1."): reason = "LXD Driver version not 3.x+ (%s)" % dver else: try: - stdout, stderr = subp(['lxc', 'console', '--help'], - decode=False) + stdout = subp(['lxc', 'console', '--help'], decode=False)[0] if not (b'console' in stdout and b'log' in stdout): reason = "no '--log' in lxc console --help" - except ProcessExecutionError as e: + except ProcessExecutionError: reason = "no 'console' command in lxc client" if reason: |
