Skip to content

Commit

Permalink
Use new comps. mock objects to re-integrate group removal. BZ 996866.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-antill committed Aug 28, 2013
1 parent eb786e9 commit 158160d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
10 changes: 2 additions & 8 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,10 +1953,7 @@ def removeGroups(self, grouplist):

groups = []
if grp_grp:
if self.conf.group_command == 'objects':
groups = self.igroups.return_environments(group_string)
else:
groups = self.comps.return_environments(group_string)
groups = self.comps.return_environments(group_string)
if not groups:
self.logger.critical(_('No environment named %s exists'), group_string)
for group in groups:
Expand All @@ -1969,10 +1966,7 @@ def removeGroups(self, grouplist):

groups = []
if pkg_grp:
if self.conf.group_command == 'objects':
groups = self.igroups.return_groups(group_string)
else:
groups = self.comps.return_groups(group_string)
groups = self.comps.return_groups(group_string)
if not groups:
self.logger.critical(_('No group named %s exists'), group_string)
for group in groups:
Expand Down
26 changes: 6 additions & 20 deletions yum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3658,10 +3658,7 @@ def groupRemove(self, grpid):
"""
txmbrs_used = []

if self.conf.group_command == 'objects':
thesegroups = self.igroups.return_groups(grpid)
else:
thesegroups = self.comps.return_groups(grpid)
thesegroups = self.comps.return_groups(grpid)
if not thesegroups:
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)

Expand All @@ -3670,12 +3667,8 @@ def groupRemove(self, grpid):

thisgroup.toremove = True

if self.conf.group_command == 'objects':
pkgs = thisgroup.pkg_names
gid = thisgroup.gid
else:
pkgs = thisgroup.packages
gid = thisgroup.groupid
pkgs = thisgroup.packages
gid = thisgroup.groupid

for pkg in pkgs:
if pkg in igroup_data and igroup_data[pkg] != 'installed':
Expand Down Expand Up @@ -3728,22 +3721,15 @@ def environmentRemove(self, evgrpid):
"""
txmbrs_used = []

if self.conf.group_command == 'objects':
thesegroups = self.igroups.return_environments(evgrpid)
else:
thesegroups = self.comps.return_environments(evgrpid)
thesegroups = self.comps.return_environments(evgrpid)
if not thesegroups:
raise Errors.GroupsError, _("No Environment named %s exists") % to_unicode(evgrpid)

for thisgroup in thesegroups:
igroup_data = self._groupInstalledEnvData(thisgroup)

if self.conf.group_command == 'objects':
grps = thisgroup.grp_names
evgid = thisgroup.evgid
else:
grps = thisgroup.allgroups
evgid = thisgroup.environmentid
grps = thisgroup.allgroups
evgid = thisgroup.environmentid

for grp in grps:
if grp in igroup_data and igroup_data[grp] != 'installed':
Expand Down

0 comments on commit 158160d

Please sign in to comment.