Bugzilla – Bug 5944
pkgsend traceback if invalid or no action type specified
Last modified: 2009-02-13 12:08:53 UTC
You need to log in before you can comment on or make changes to this bug.
If pkgsend is run without an action type after the "add" you get a traceback. For example (note the "file" type is missing after the "add"): $ pkgsend add ~/foo.txt mode=0777 user=bin group=bin path=foo/foo.txt Traceback (most recent call last): File "/home/trm/pkg-toolkit/pkg/bin/publish.py", line 350, in ? ret = main_func() File "/home/trm/pkg-toolkit/pkg/bin/publish.py", line 323, in main_func trans_add(pcfg, pargs) File "/home/trm/pkg-toolkit/pkg/bin/publish.py", line 169, in trans_add action = pkg.actions.fromlist(args[0], args[1:]) File "/home/trm/pkg-toolkit/pkg/vendor-packages/pkg/actions/__init__.py", line 171, in fromlist action = types[type](**attrs) KeyError: '/home/trm/foo.txt' Suggested fix: If an invalid action type is specified after the add, a usage message should be printed.
Just need action to check the action type in fromlist and have pkgsend catch any relevant exceptions gracefully.
Will now print something like: pkgsend: Unknown action type '/export/home/xxx/foo.txt' in action '/export/home/xxx/foo.txt mode=0777 user=bin group=bin path=foo/foo.txt'
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.