apport question will not accept multi-character responses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Confirmed
|
Undecided
|
Unassigned | ||
apport (Ubuntu) |
Fix Released
|
Medium
|
Brian Murray | ||
Xenial |
Fix Released
|
Medium
|
Brian Murray | ||
Zesty |
Fix Released
|
Medium
|
Brian Murray | ||
Artful |
Fix Released
|
Medium
|
Brian Murray |
Bug Description
=== Begin SRU Template ===
[Impact]
Packages which provide apport integration with more than 9 options in a choice will not be able to select options numbered >= 10 on the commandline using 'ubuntu-bug <package-name>'
[Test Case]
Overview:
1. Update to proposed versions of cloud-init v. 17.1 and apport v. <X>
2. Run 'ubuntu-bug cloud-init' attempt to report a bug on a cloud choice greater than 9
3. View report and make sure the proper cloud is reported
Script:
if [ ! -f './lxc-
wget https:/
chmod 755 lxc-proposed-
fi
for release in xenial artful; do
echo "$release START --------------";
lxc init $ref test-$release;
lxc start test-$release;
lxc exec test-$release -- apt install apport;
lxc exec test-$release -- dpkg-query --show apport;
lxc exec test-$release -- ubuntu-bug cloud-init;
done
[Regression Potential]
Minimal. This bug only affects packages with >9 bug filing options for a given choice. Worst case, is bugs filed would incorrectly represent option 1 of a selection instead of option 1X.
=== End SRU Template ===
=== original description ===
the newly added cloud-init apport support shows a list of cloud providers and asks the user to select one. There are currently 18 options. For any option > 10, apport will just take the '1' that is typed as the answer.
It should obviously wait for more than one character or a carriage return.
*** Please select the cloud vendor or environment in which this instance is running
Choices:
1: Amazon - Ec2
2: AliYun
3: AltCloud
4: Azure
5: Bigstep
6: CloudSigma
7: CloudStack
8: DigitalOcean
9: GCE - Google Compute Engine
10: MAAS
11: NoCloud
12: OpenNebula
13: OpenStack
14: OVF
15: Scaleway
16: SmartOS
17: VMware
18: Other
C: Cancel
Please choose (1/2/3/
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: apport 2.20.7-0ubuntu2
ProcVersionSign
Uname: Linux 4.13.0-12-generic x86_64
ApportVersion: 2.20.7-0ubuntu2
Architecture: amd64
Date: Tue Oct 10 15:21:48 2017
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Scott Moser (community): Approve
- Apport upstream developers: Pending requested
-
Diff: 60 lines (+23/-7)1 file modifiedbin/apport-cli (+23/-7)
Changed in apport: | |
status: | New → Confirmed |
tags: | added: id-59ef68f44b84c4117299967c |
Changed in apport (Ubuntu Artful): | |
importance: | Medium → Low |
importance: | Low → Medium |
description: | updated |
Changed in apport (Ubuntu Zesty): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in apport (Ubuntu Xenial): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in apport (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in apport (Ubuntu Zesty): | |
importance: | Undecided → Medium |
For reasons unknown to me apport-cli only reads one character.
37 def raw_input_ char(self, prompt): write(prompt) tcgetattr( file) tcgetattr( file) 6][termios. VMIN] = 1 6][termios. VTIME] = 0 tcsetattr( file, termios.TCSANOW, attributes) stdin.read( 1)) tcsetattr( file, termios.TCSANOW, saved_attributes) write(' \n')
38 '''raw_input, but read only one character'''
39
40 sys.stdout.
41 sys.stdout.write(' ')
42 sys.stdout.flush()
43
44 file = sys.stdin.fileno()
45 saved_attributes = termios.
46 attributes = termios.
47 attributes[3] = attributes[3] & ~(termios.ICANON)
48 attributes[
49 attributes[
50 termios.
51
52 try:
53 ch = str(sys.
54 finally:
55 termios.
56
57 sys.stdout.
58 return ch