Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 972913 - an unexpected error occurs when the --cond-name option is used with repo uploads group
an unexpected error occurs when the --cond-name option is used with repo uplo...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Retired
Component: rpm-support (Show other bugs)
2.2 Beta
Unspecified Unspecified
low Severity low
: ---
: 2.3.0
Assigned To: Sayli Karmarkar
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 15:23 EDT by Jeremy Cline
Modified: 2015-03-22 21:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-09 09:31:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeremy Cline 2013-06-10 15:23:12 EDT
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
Comment 1 Jeremy Cline 2013-06-12 17:17:07 EDT
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 ':'.
Comment 3 Sayli Karmarkar 2013-09-06 16:09:56 EDT
commit 1098334a6edd8083bde1134c9ae594fda1d45bb7
Author: Sayli Karmarkar <skarmark@redhat.com>
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
Comment 4 Sayli Karmarkar 2013-09-17 15:51:59 EDT
Merged.
Comment 5 Jeff Ortel 2013-09-18 19:58:51 EDT
build: 2.3.0-0.14.alpha
Comment 6 Preethi Thomas 2013-09-19 16:28:10 EDT
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
Comment 7 Preethi Thomas 2013-12-09 09:31:47 EST
Pulp 2.3 released.

Note You need to log in before you can comment on or make changes to this bug.