Bug 623272 - unsupported type "Conditional" existing in packagegroup
unsupported type "Conditional" existing in packagegroup
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: John Matthews
Preethi Thomas
: FutureFeature, QA-Closed, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-11 14:29 EDT by Preethi Thomas
Modified: 2011-07-15 15:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-20 12:11:38 EDT
Type: ---
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 Preethi Thomas 2010-08-11 14:29:04 EDT
Description of problem:

[root@preethi pulp]# pulp -u admin -p admin packagegroup info --id=pthomas --repoid=f13
+-------------------------------------------+
Package Group Information
+-------------------------------------------+

Name                	pthomas                  
Id                  	pthomas                  
Mandatory packages  	[u'zsh-4.3.10-5.fc13.x86_64.rpm']
Default packages    	[u'zlib-1.2.3-23.fc12.i686.rpm', u'zbar-0.10-2.fc13.x86_64.rpm']
Optional packages   	[u'zlib-devel-1.2.3-23.fc12.i686.rpm']
Conditional packages	{}                       

[root@preethi pulp]# pulp -u admin -p admin packagegroup add_package --repoid=f13 --id=pthomas --pkgname=zd1211-firmware-1.4-4.fc13.noarch.rpm --type=conditional
"Traceback (most recent call last):\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/controllers/base.py\", line 50, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/role_check.py\", line 102, in check_roles\n    ret=f(instance, *fargs, **kw)\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/controllers/repositories.py\", line 302, in add_package_to_group\n    return self.ok(api.add_package_to_group(id, groupid, pkg_name, gtype))\n  File \"/usr/lib/python2.6/site-packages/pulp/auditing.py\", line 191, in _audit\n    result = method(*args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/api/repo.py\", line 403, in add_package_to_group\n    raise NotImplementedError(\"No support for creating conditional groups\")\nNotImplementedError: No support for creating conditional groups\n"
[root@preethi pulp]# 
[root@preethi pulp]# 
[root@preethi pulp]# pulp -u admin -p admin packagegroup add_package --help
Usage: pulp -u <username> -p <password> packagegroup add_package [OPTIONS]


Options:
  -h, --help            show this help message and exit
  --repoid=REPOID       Repository Label
  --id=GROUPID          Group id
  --pkgname=PKGNAME     Package name
  --type=GROUPTYPE      Type of list to add package to, example 'mandatory',
                        'optional', 'default'
  -u USERNAME, --username=USERNAME
                        <REQUIRED> username for access to Pulp.  Default user
                        admin is included with base install.
  -p PASSWORD, --password=PASSWORD
                        <REQUIRED> password for access to Pulp.
Comment 1 Pradeep Kilambi 2010-08-17 10:44:51 EDT
Future Feature
Comment 2 Todd Sanders 2010-09-24 11:10:55 EDT
Aligned to Sprint 16
Comment 3 John Matthews 2010-10-14 09:23:28 EDT
Conditional package groups allow a package to be conditionally installed, meaning it will only be installed if a condition is met.  The condition is if the 'requires' package is present.  

Below is a XML snippet of a package group with a conditional type 
 <group>
    <id>afrikaans-support</id>
    <name>Afrikaans Support</name>
    <description/>
    <default>false</default>
    <uservisible>false</uservisible>
    <langonly>af</langonly>
    <packagelist>
      <packagereq requires='aspell' type='conditional'>aspell-af</packagereq>
    </packagelist>
  </group>

If someone runs: "yum groupinstall afrikaans-support" the package 'aspell-af' will only be installed if the requires package, 'aspell' is installed.


Below commit contains the git commit:

http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=27c0c414549be80aba0c2c0401e0384aabc7585b


CLI Arguments:

pulp-admin -u USER -p PASS packagegroup add_package --repoid repo1 --id afrikaans-support --type conditional --requires 'aspell' -n 'aspell-af'
Comment 4 Jay Dobies 2010-10-15 08:24:15 EDT
Fixed in the 0.73 release.
Comment 5 John Matthews 2010-10-15 08:48:03 EDT
This will be in 0.74
Comment 6 Jay Dobies 2010-10-15 14:52:43 EDT
Included in build 0.74.
Comment 7 Preethi Thomas 2010-10-18 16:35:40 EDT
verified

[root@preethi ~]# pulp-admin packagegroup add_package  --repoid=f13 --id=preethi -n zip --type=conditional --requires zsh
Following packages added to group [preethi] in repository [f13] for required package [zsh]: 
 ['zip']


[root@preethi ~]# pulp-admin packagegroup info  --repoid=f13 --id=preethi +------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                	preethi                  
Id                  	preethi                  
Mandatory packages  	[]                       
Default packages    	[u'zsh']                 
Optional packages   	[]                       
Conditional packages	{u'zip': u'zsh'}
Comment 8 Preethi Thomas 2010-10-20 12:11:38 EDT
Closed after review.

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