Description of problem: an unexpected error occurs when the --cond-name option is used with 'pulp-admin rpm repo uploads group' Version-Release number of selected component (if applicable): pulp-rpm-admin-extensions-2.2.0-0.2.beta.fc18.noarch How reproducible: Seems to occur any time --cond-name is used Steps to Reproduce: 1. pulp-admin rpm repo uploads group --repo-id=uploads_group --group-id=test_group --name=test --description="A test of uploads group" --cond-name=conditional Actual results: +----------------------------------------------------------------------+ Unit Upload +----------------------------------------------------------------------+ Extracting necessary metadata for each request... An unexpected error has occurred. More information can be found in the client log file ~/.pulp/admin.log. Expected results: Something similar to +----------------------------------------------------------------------+ Unit Upload +----------------------------------------------------------------------+ Extracting necessary metadata for each request... ... completed Creating upload requests on the server... [==================================================] 100% Initializing upload ... completed Starting upload of selected units. If this process is stopped through ctrl+c, the uploads will be paused and may be resumed later using the resume command or cancelled entirely using the cancel command. Importing into the repository... ... completed Deleting the upload request... ... completed Additional info: [jcline@jcline ~]$ cat ~/.pulp/admin.log 2013-06-10 15:22:08,077 - ERROR - Client-side exception occurred Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run exit_code = Cli.run(self, args) File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run exit_code = command_or_section.execute(self.prompt, remaining_args) File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute return self.method(*arg_list, **clean_kwargs) File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/upload.py", line 173, in run unit_key, unit_metadata = self.generate_unit_key_and_metadata(None, **kwargs) File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/upload.py", line 299, in generate_unit_key_and_metadata metadata = self.generate_metadata(filename, **kwargs) File "/usr/lib/python2.7/site-packages/pulp_rpm/extension/admin/upload/group.py", line 111, in generate_metadata key, value = entry.split(':') ValueError: need more than 1 value to unpack
I just noticed that the --cond-name option expects the format "pkg_name : required_package". When provided this format uploads group performs as expected. This is just a matter of not checking the input for correct formatting before splitting on ':'.
commit 1098334a6edd8083bde1134c9ae594fda1d45bb7 Author: Sayli Karmarkar <skarmark> Date: Fri Sep 6 12:54:49 2013 -0700 972913 - adding cli validation for conditional packages when upload a package group $ pulp-admin rpm repo uploads group --repo-id=test-repo --group-id=test_group --name=test --description="A test of uploads group" --cond-name=conditional +----------------------------------------------------------------------+ Unit Upload +----------------------------------------------------------------------+ Extracting necessary metadata for each request... Invalid value for argument : cond-name
Merged.
build: 2.3.0-0.14.alpha
verified [root@pulp-v2-server ~]# rpm -qa pulp-server pulp-server-2.3.0-0.14.alpha.el6.noarch [root@pulp-v2-server ~]# [root@pulp-v2-server ~]# pulp-admin rpm repo uploads group --repo-id=uploads_group --group-id=test_group --name=test --description="A test of uploads group" --cond-name=conditional +----------------------------------------------------------------------+ Unit Upload +----------------------------------------------------------------------+ Extracting necessary metadata for each request... Invalid value for argument : cond-name
Pulp 2.3 released.