diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-12-19 15:51:43 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-20 15:22:17 +0000 |
commit | 2f4008d6948a85ed8c35ffcc8dbfaa47d406c55d (patch) | |
tree | 64e64f9243e3eaf5faa3ec5bddfadc4db4fd0646 /meta/lib/oeqa/utils/metadata.py | |
parent | 041ac0f9c109308543153ed348995971b8bcdbd6 (diff) | |
download | poky-2f4008d6948a85ed8c35ffcc8dbfaa47d406c55d.tar.gz |
oe-selftest: import git module only when needed
git module is not included into standard Python
library and therefore causes import errors on the systems
where PythonGit is not installed.
As git module only used in the code implementing --repository
functionality it's better to import git only in the scope
that requires it.
[YOCTO #10821]
(From OE-Core rev: 66be32c1a075201d6ee0e9b9e10b84e6a2ace745)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/metadata.py')
-rw-r--r-- | meta/lib/oeqa/utils/metadata.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py index ecbe763c0f..5d8bf84755 100644 --- a/meta/lib/oeqa/utils/metadata.py +++ b/meta/lib/oeqa/utils/metadata.py | |||
@@ -5,7 +5,6 @@ | |||
5 | # Functions to get metadata from the testing host used | 5 | # Functions to get metadata from the testing host used |
6 | # for analytics of test results. | 6 | # for analytics of test results. |
7 | 7 | ||
8 | from git import Repo, InvalidGitRepositoryError, NoSuchPathError | ||
9 | from collections import OrderedDict | 8 | from collections import OrderedDict |
10 | from collections.abc import MutableMapping | 9 | from collections.abc import MutableMapping |
11 | from xml.dom.minidom import parseString | 10 | from xml.dom.minidom import parseString |
@@ -46,6 +45,7 @@ def metadata_from_data_store(d): | |||
46 | 45 | ||
47 | def get_layers(layers): | 46 | def get_layers(layers): |
48 | """ Returns layer name, branch, and revision as OrderedDict. """ | 47 | """ Returns layer name, branch, and revision as OrderedDict. """ |
48 | from git import Repo, InvalidGitRepositoryError, NoSuchPathError | ||
49 | 49 | ||
50 | layer_dict = OrderedDict() | 50 | layer_dict = OrderedDict() |
51 | for layer in layers.split(): | 51 | for layer in layers.split(): |