Public bug reported: After installing apparmor, apparmor-utils, and libapache2-mod-apparmor and enabling a virtual host that uses the changehat feature, it is impossible to "(A)dd Requested Hat" or "(U)se Default Hat" because there isinconsistent use of q.promptUser() call in the " elif type == 'unknown_hat' block on line 1097 in aa.py
Changing ans = q.promptUser() to ans = q.promptUser()[0].strip() OR ans, selected = q.promptUser() OR ans, arg = q.promptUser() resolves this problem because ans is no longer assigned a tuple data type and can be evaluated against CMD_* variables Further execution of code inside the 'unknown_hat' elif block is buggy but not within the scope of this bug report. --- Debugging info: uname -a: Linux hostname 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux cat /etc/issue Ubuntu 16.04.3 LTS \n \l apt-cache policy apparmor-utils apparmor-utils: Installed: 2.10.95-0ubuntu2.8 Candidate: 2.10.95-0ubuntu2.8 *** 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status apt-cache policy apparmor apparmor: Installed: 2.10.95-0ubuntu2.6 Candidate: 2.10.95-0ubuntu2.8 Version table: 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages apt-cache policy libapache2-mod-apparmor libapache2-mod-apparmor: Installed: 2.10.95-0ubuntu2.8 Candidate: 2.10.95-0ubuntu2.8 Version table: *** 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status ** Affects: apparmor (Ubuntu) Importance: Undecided Status: New ** Description changed: After installing apparmor, apparmor-utils, and libapache2-mod-apparmor and enabling a virtual host that uses the changehat feature, it is impossible to "(A)dd Requested Hat" or "(U)se Default Hat" because there isinconsistent use of q.promptUser() call in the " elif type == 'unknown_hat' block on line 1097 in aa.py - Changing - ans = q.promptUser() + Changing + ans = q.promptUser() to - ans = q.promptUser()[0].strip() + ans = q.promptUser()[0].strip() OR - ans, selected = q.promptUser() + ans, selected = q.promptUser() OR - ans, arg = q.promptUser() + ans, arg = q.promptUser() resolves this problem because ans is no longer assigned a tuple data type and can be evaluated against CMD_* variables Further execution of code inside the 'unknown_hat' elif block is buggy but not within the scope of this bug report. --- Debugging info: uname -a: Linux hostname 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux cat /etc/issue Ubuntu 16.04.3 LTS \n \l apt-cache policy apparmor-utils apparmor-utils: - Installed: 2.10.95-0ubuntu2.8 - Candidate: 2.10.95-0ubuntu2.8 - *** 2.10.95-0ubuntu2.8 500 - 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages - 100 /var/lib/dpkg/status + Installed: 2.10.95-0ubuntu2.8 + Candidate: 2.10.95-0ubuntu2.8 + *** 2.10.95-0ubuntu2.8 500 + 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages + 100 /var/lib/dpkg/status + apt-cache policy apparmor apparmor: - Installed: 2.10.95-0ubuntu2.6 - Candidate: 2.10.95-0ubuntu2.8 - Version table: - 2.10.95-0ubuntu2.8 500 - 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages - apt-cache policy libapache2-mod-apparmor + Installed: 2.10.95-0ubuntu2.6 + Candidate: 2.10.95-0ubuntu2.8 + Version table: + 2.10.95-0ubuntu2.8 500 + 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages + + apt-cache policy libapache2-mod-apparmor libapache2-mod-apparmor: - Installed: 2.10.95-0ubuntu2.8 - Candidate: 2.10.95-0ubuntu2.8 - Version table: - *** 2.10.95-0ubuntu2.8 500 - 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages - 100 /var/lib/dpkg/status + Installed: 2.10.95-0ubuntu2.8 + Candidate: 2.10.95-0ubuntu2.8 + Version table: + *** 2.10.95-0ubuntu2.8 500 + 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages + 100 /var/lib/dpkg/status -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to apparmor in Ubuntu. https://bugs.launchpad.net/bugs/1752365 Title: Cannot Add Request Hat or Use Default Hat in aa-logprof and mod_apparmor Status in apparmor package in Ubuntu: New Bug description: After installing apparmor, apparmor-utils, and libapache2-mod-apparmor and enabling a virtual host that uses the changehat feature, it is impossible to "(A)dd Requested Hat" or "(U)se Default Hat" because there isinconsistent use of q.promptUser() call in the " elif type == 'unknown_hat' block on line 1097 in aa.py Changing ans = q.promptUser() to ans = q.promptUser()[0].strip() OR ans, selected = q.promptUser() OR ans, arg = q.promptUser() resolves this problem because ans is no longer assigned a tuple data type and can be evaluated against CMD_* variables Further execution of code inside the 'unknown_hat' elif block is buggy but not within the scope of this bug report. --- Debugging info: uname -a: Linux hostname 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux cat /etc/issue Ubuntu 16.04.3 LTS \n \l apt-cache policy apparmor-utils apparmor-utils: Installed: 2.10.95-0ubuntu2.8 Candidate: 2.10.95-0ubuntu2.8 *** 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status apt-cache policy apparmor apparmor: Installed: 2.10.95-0ubuntu2.6 Candidate: 2.10.95-0ubuntu2.8 Version table: 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages apt-cache policy libapache2-mod-apparmor libapache2-mod-apparmor: Installed: 2.10.95-0ubuntu2.8 Candidate: 2.10.95-0ubuntu2.8 Version table: *** 2.10.95-0ubuntu2.8 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1752365/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

