=== modified file 'doc/changes.rst'
@@ -9,6 +9,8 @@
* Allow users to override ``analyzer_assigned_uuid`` by passing
``--analyzer-assigned-uuid`` to the run command. This change fixes
https://bugs.launchpad.net/lava-dispatcher/+bug/934164
+ * Improved error output when running inside virtualenv where the apt and
+ lsb_release modules are not visible to python.
.. _version_0_4:
=== modified file 'lava_test/commands.py'
@@ -260,11 +260,23 @@
except RuntimeError as ex:
raise LavaCommandError(str(ex))
self.say("run complete, result_id is {0!r}", artifacts.result_id)
- artifacts.create_initial_bundle(
- self.args.skip_software_context,
- self.args.skip_hardware_context,
- self.args.trusted_time,
- self.args.analyzer_assigned_uuid)
+ try:
+ artifacts.create_initial_bundle(
+ self.args.skip_software_context,
+ self.args.skip_hardware_context,
+ self.args.trusted_time,
+ self.args.analyzer_assigned_uuid)
+ except ImportError as exc:
+ msg_template = (
+ "Unable to probe for software context. Install the '%s'"
+ " package or invoke lava-test run with"
+ " '--skip-software-context'")
+ if exc.message == "No module named apt":
+ raise LavaCommandError(msg_template % "python-apt")
+ elif exc.message == "No module named lsb_release":
+ raise LavaCommandError(msg_template % "lsb-release")
+ else:
+ raise
artifacts.save_bundle()
if self.args.output:
parse_results = test.parse(artifacts)
=== modified file 'lava_test/core/swprofile.py'
@@ -13,8 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import apt
-
from lava_test.utils import read_file
@@ -23,6 +21,7 @@
apt_cache - if not provided, this will be read from the system
"""
+ import apt
if apt_cache == None:
apt_cache = apt.Cache()
packages = []