Skip to content

Commit

Permalink
qitoolchain: fix breakage introduced by post_add
Browse files Browse the repository at this point in the history
The post_add method was calling method "load_package_xml", which was
overriding variables written by method "reroot_path".

Remove the call to load_package_xml in qipackage, as it is always called
in database.py before calling post_add.

The API is rather brittle, let's fix it in a subsequent commit

Change-Id: I0f9b4012bc368eb66b882fb50b0f2a0ae3f9d870
Reviewed-on: http://gerrit.aldebaran.lan/78081
Reviewed-by: plemagourou <[email protected]>
Tested-by: gerrit
  • Loading branch information
Noé Rubinstein authored and nrubinstein committed Dec 9, 2016
1 parent 6bb5b98 commit a394072
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions python/qitoolchain/qipackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ def post_add(self):
* CommandFailedException if the post-add script fails
"""

# Make sure the post-add is loaded
self.load_package_xml()

if not self._post_add:
return

Expand Down
2 changes: 2 additions & 0 deletions python/qitoolchain/test/test_qipackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def test_post_add_does_not_exist(tmpdir):
""")

package = qitoolchain.qipackage.QiPackage("boost", path=boost_path.strpath)
package.load_package_xml()

# pylint: disable-msg=E1101
with pytest.raises(qisys.command.NotInPath):
Expand All @@ -215,6 +216,7 @@ def test_post_add(tmpdir):
os.chmod(script.strpath, 0755)

package = qitoolchain.qipackage.QiPackage("boost", path=boost_path.strpath)
package.load_package_xml()

package.post_add()

Expand Down

0 comments on commit a394072

Please sign in to comment.