Bug 972913 - an unexpected error occurs when the --cond-name option is used with repo uploads group
Summary: an unexpected error occurs when the --cond-name option is used with repo uplo...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support (Show other bugs)
(Show other bugs)
Version: 2.2 Beta
Hardware: Unspecified Unspecified
low
low
Target Milestone: ---
: 2.3.0
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-10 19:23 UTC by Jeremy Cline
Modified: 2015-03-23 01:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-09 14:31:47 UTC
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)

Description Jeremy Cline 2013-06-10 19:23:12 UTC
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 21:17:07 UTC
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 20:09:56 UTC
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 19:51:59 UTC
Merged.

Comment 5 Jeff Ortel 2013-09-18 23:58:51 UTC
build: 2.3.0-0.14.alpha

Comment 6 Preethi Thomas 2013-09-19 20:28:10 UTC
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 14:31:47 UTC
Pulp 2.3 released.


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