diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2019-07-10 23:17:12 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-07-10 23:17:12 +0000 |
commit | 217c89369c3b16f11333f0090e059f76fc5d7937 (patch) | |
tree | 6e1595e7e3cde030d52209362b32bb629ed25191 | |
parent | 5e4792cd11a4754384bd70e4dc94413976017ae8 (diff) | |
download | vyos-cloud-init-217c89369c3b16f11333f0090e059f76fc5d7937.tar.gz vyos-cloud-init-217c89369c3b16f11333f0090e059f76fc5d7937.zip |
Fix a couple of issues raised by a coverity scan
* cc_lxd: fix copy/paste error in debug logging
* DataSourceCloudSigma: remove unreachable code
* This unreachable code was introduced in a refactor (in 2015) which
removed the need for an exception handler, but retained the logging
from the exception handler as an unreachable fall-through.
-rw-r--r-- | cloudinit/config/cc_lxd.py | 2 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceCloudSigma.py | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/cloudinit/config/cc_lxd.py b/cloudinit/config/cc_lxd.py index 71d13ed8..d9830770 100644 --- a/cloudinit/config/cc_lxd.py +++ b/cloudinit/config/cc_lxd.py @@ -152,7 +152,7 @@ def handle(name, cfg, cloud, log, args): if cmd_attach: log.debug("Setting up default lxd bridge: %s" % - " ".join(cmd_create)) + " ".join(cmd_attach)) _lxc(cmd_attach) elif bridge_cfg: diff --git a/cloudinit/sources/DataSourceCloudSigma.py b/cloudinit/sources/DataSourceCloudSigma.py index 2955d3f0..df88f677 100644 --- a/cloudinit/sources/DataSourceCloudSigma.py +++ b/cloudinit/sources/DataSourceCloudSigma.py @@ -42,12 +42,8 @@ class DataSourceCloudSigma(sources.DataSource): if not sys_product_name: LOG.debug("system-product-name not available in dmi data") return False - else: - LOG.debug("detected hypervisor as %s", sys_product_name) - return 'cloudsigma' in sys_product_name.lower() - - LOG.warning("failed to query dmi data for system product name") - return False + LOG.debug("detected hypervisor as %s", sys_product_name) + return 'cloudsigma' in sys_product_name.lower() def _get_data(self): """ |