Bug 1305612 - '0' toggles selection of the repo with the maximum value
Summary: '0' toggles selection of the repo with the maximum value
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.1.2
: 3.1.x
Assignee: Pavlina Bartikova
QA Contact: Radek Bíba
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-08 17:34 UTC by Irina Gulina
Modified: 2019-09-12 13:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
if user passes in a zero, the "maximum value will be selected. This can cause unintended habaviour such as deleting repos.
Clone Of:
Environment:
Last Closed: 2019-09-12 13:23:38 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:2757 0 None None None 2019-09-12 13:23:41 UTC

Description Irina Gulina 2016-02-08 17:34:52 UTC
Description of problem:

When one deletes repositories and is prompted to toggle selection (e.g. 'Enter value (1-2) to toggle selection'), and if s/he enters '0', the last repo will be marked to be deleted. However, if to enter '3' or any other number out of the range, nothing will happen. 

Version-Release number of selected component (if applicable):
>> rpm -qa '*rhui*'
rh-amazon-rhui-client-rhs30-2.2.124-1.el7.noarch
rhui-installer-base-0.0.24-1.el7ui.noarch
rh-rhui-tools-libs-pre.3.0.16-1.el7ui.noarch
rhui-installer-0.0.24-1.el7ui.noarch
rh-rhui-tools-pre.3.0.16-1.el7ui.noarch
rhui-default-ca-1.0-1.noarch
rh-amazon-rhui-client-2.2.118-1.el7.noarch

RHUI ISO 20151013

How reproducible:
always

How reproducible:

>> rhui (home) => r

>> rhui (repo) => l

Steps to Reproduce:
Custom Repositories
  custom-i386-i386
  custom-i386-x86_64
  custom-x86_64-x86_64


------------------------------------------------------------------------------
>> rhui (repo) => d

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64

  Red Hat Repositories

>> Enter value (1-3) to toggle selection, 'c' to confirm selections, or '?' for more commands: 0

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    x  3 : custom-x86_64-x86_64

  Red Hat Repositories

>> Enter value (1-3) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


The following repositories will be deleted:
  Custom Repositories
    custom-x86_64-x86_64

>> Proceed? (y/n) y


Delete custom-x86_64-x86_64 task has been queued up...repo will be deleted at the next available time slot


Actual results:
The repo will be deleted


Expected results:
No action when '0' is entered, like for any other nonexisitng repo number/value: 

>> rhui (repo) => d

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64

  Red Hat Repositories

>> Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 3

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands:

Comment 3 Irina Gulina 2016-02-08 17:57:56 UTC
Please note, if to write '0' before index, it also will change the selection: 

>> Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 01

Select one or more repositories:

  Custom Repositories
    x  1 : custom-i386-i386
    -  2 : custom-i386-x86_64

  Red Hat Repositories

>> Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 02

Select one or more repositories:

  Custom Repositories
    x  1 : custom-i386-i386
    x  2 : custom-i386-x86_64

  Red Hat Repositories

>> Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 01-02

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64


Try many zeroes: 

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    x  2 : custom-i386-x86_64

  Red Hat Repositories

>> Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 000000002

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64

  Red Hat Repositories

Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands:

Comment 4 Irina Gulina 2016-02-09 17:09:57 UTC
'0' also toggles selection for displaying detailed information on a repository

------------------------------------------------------------------------------
rhui (repo) => i

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    -  3 : custom-x86_64-x86_64

  Red Hat Repositories

Enter value (1-3) to toggle selection, 'c' to confirm selections, or '?' for more commands: 0

Select one or more repositories:

  Custom Repositories
    -  1 : custom-i386-i386
    -  2 : custom-i386-x86_64
    x  3 : custom-x86_64-x86_64

  Red Hat Repositories

Enter value (1-3) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Name:                custom-x86_64-x86_64
Type:                Custom
Relative Path:       custom/x86_64/x86_64
GPG Check:           Yes
Custom GPG Keys:     (None)
Red Hat GPG Key:     Yes
Package Count:       0


------------------------------------------------------------------------------
rhui (repo) =>

Comment 6 Irina Gulina 2016-10-04 14:47:25 UTC
It seems 0 always toggles an item with a maximum value, e.g. on adding a RH repo: 

rhui (repo) => a

Determining undeployed products...
... product list calculated

Import Repositories:
  1  - All in Certificate
  2  - By Product
  3  - By Repository
Enter value (1-3) or 'b' to abort: 0

Select the product repositories to be deployed to the RHUI (only undeployed
products are displayed):
  Red Hat Enterprise Linux 5 Update Infrastructure MRG 2.0 (SRPMS)
    -  1 : Red Hat Enterprise Linux 5 Update Infrastructure MRG 2.0 (SRPMS) (5Server-x86_64) (Yum)
    -  2 : Red Hat Enterprise Linux 5 Update Infrastructure MRG 2.0 (SRPMS) (5Server-i386) (Yum)

  Red Hat Storage 2 VSA Beta (RPMs) from RHUI
    -  3 : Red Hat Storage 2 VSA Beta (RPMs) from RHUI (x86_64) (Yum)

  RHEL RHUI Server 7 Rh-common OS
    -  4 : RHEL RHUI Server 7 Rh-common OS (7Server-x86_64) (Yum)

  RHEL RHUI Server 6 Rhscl 1 Debug
    -  5 : RHEL RHUI Server 6 Rhscl 1 Debug (6Server-i386) (Yum)
    -  6 : RHEL RHUI Server 6 Rhscl 1 Debug (6Server-x86_64) (Yum)


I expect nothing to happen when 0 is entered.

Comment 7 Radek Bíba 2019-08-16 10:02:18 UTC
There's in fact one more case where 0 was handled incorrectly. Scenario:

1 - add a load balancer or a CDS (if you don't have either)
2 - enter d on the load balancer or CDS management screen
3 - enter 0
4 - enter 1
5 - enter c

-> unexpected error, details in rhui.log:
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/instances.py", line 297, in unregister
    unregistered_instances.append(instance_config.pop(selection))

The modified code fixes this too.

Comment 8 Radek Bíba 2019-08-16 10:09:36 UTC
Oops, the last line of the traceback was left behind in the previous comment: IndexError: pop from empty list.

Comment 13 errata-xmlrpc 2019-09-12 13:23:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:2757


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