--- a/src/modules/actions/__init__.py Fri Sep 14 10:29:11 2012 +0530
+++ b/src/modules/actions/__init__.py Tue Sep 25 14:57:02 2012 +0530
@@ -346,7 +346,10 @@
return None, None
if payload == "NOHASH":
- filepath = os.path.sep + action.attrs["path"]
+ try:
+ filepath = os.path.sep + action.attrs["path"]
+ except KeyError:
+ raise InvalidPathAttributeError(action)
else:
filepath = payload
--- a/src/tests/cli/t_pkgsend.py Fri Sep 14 10:29:11 2012 +0530
+++ b/src/tests/cli/t_pkgsend.py Tue Sep 25 14:57:02 2012 +0530
@@ -1269,6 +1269,17 @@
self.pkgsend("", "-s %s publish %s" %
(self.dc.get_repo_url(), mfpath), exit=1)
+ def test_25_pkgsend_publish_nohash_license(self):
+ """Verify that publishing a manifest with hash attribute
+ missing for license action doesn't traceback"""
+
+ durl = self.dc.get_depot_url()
+ # Should fail because hash attribute is missing.
+ self.pkgsend_bulk(durl,
+ """open [email protected]
+ add license license=copyright
+ close""", exit=1)
+
class TestPkgsendHardlinks(pkg5unittest.CliTestCase):