Bug 814836 - activationkey.listActivationKeys() returns all activation keys instead only visible to the user
Summary: activationkey.listActivationKeys() returns all activation keys instead only v...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 1.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space18
TreeView+ depends on / blocked
 
Reported: 2012-04-20 19:53 UTC by Marcelo Moreira de Mello
Modified: 2012-11-01 16:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 814838 (view as bug list)
Environment:
Last Closed: 2012-11-01 16:17:40 UTC
Embargoed:


Attachments (Terms of Use)
Reproducer script (1.04 KB, text/x-python)
2012-04-20 19:53 UTC, Marcelo Moreira de Mello
no flags Details
patch to show only custom activation keys (3.38 KB, patch)
2012-04-23 20:53 UTC, Shannon Hughes
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 814838 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 814838

Description Marcelo Moreira de Mello 2012-04-20 19:53:12 UTC
Created attachment 579101 [details]
Reproducer script

Description of problem:
activationkey.listActivationKeys() returns all activation keys instead only visible for the user


Version-Release number of selected component (if applicable):
Spacewalk 1.7

How reproducible:
100%


Steps to Reproduce:
1. Use reproducer attached
2.
3.
  
Actual results:

Auto-generated activation keys are being listed when API method activationkey.listActivationKeys() is called


Expected results:

 Only the custom activation keys (not auto-generated) be displayed


Additional info:

theo $> python list-activationkeys.py 

Total ActivationKeys (5)
----------------------------------------
	key:	         1-rhel5-bare-metal-x86_64
	description:	 rhel5-bare-metal-x86_64
	usage_limit:	 0

	key:	         1-rhel4-vms-x86_64
	description:	 rhel4-vms-x86_64
	usage_limit:	 0

	key:	         1-rhel6-vms-x86_64
	description:	 rhel6-vms-x86_64
	usage_limit:	 0

	key:	         1-rhel5-vms-x86_64
	description:	 rhel5-vms-x86_64
	usage_limit:	 0

	key:	         1-rhel6-bare-metal-x86_64
	description:	 rhel6-bare-metal-x86_64
	usage_limit:	 0


Keys Excluded: (26)
********************************
	key:	         1-1f19381f55af5da152e62103ab85c66e
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         1-fbdbf49c82ea03a20905388aae1253dd
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         1-c8dc7bac55211e8c23e1d7577cbe91aa
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-36c7bceefdc191922839a43f43909236
	description:	 Reactivation key for serverA.domain-example.com.
	usage_limit:	 0

	key:	         1-0a09258b40d73e83cc078a07566b5696
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-9e4bc9a46aa789b1edd6521d02cda4c8
	description:	 Reactivation key for serverA-1.domain-example.com.
	usage_limit:	 0

	key:	         1-557da00c37e3b264e54051dbd6c7c674
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-c3d5324ad26e4e1e35235ba4896887cb
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

	key:	         1-3bd2635254303d35fce4d86dd92216c6
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-66514ddef24b9109dd6fca7677bbc335
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

	key:	         1-d57100ec86994b18547ebf8041f7ba07
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-285093340c4d1a2619c8e87fb01f4844
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

	key:	         1-4f8373b4cd9e3a78c72da24ba745faff
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-8af05dcd5e9f23ed5934fa8abc60db4f
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

	key:	         1-9a9e22754c6259e9fc9f4a18c38aa33b
	description:	 Chave de reativação do kickstart para  .
	usage_limit:	 0

	key:	         1-67f12964d3a05f1b9a0dca7e83a758bb
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         1-db0245081ad701b676aeddaeddb96baa
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         1-78c09592a5348e2928d291e47476fe3a
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-98a6ca7e5798ab7ac378985ba63b4877
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

	key:	         1-53570e88999707d8824e3693496eb996
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         1-4d5e4c9de4e43a90c72b6bc9412f5f2e
	description:	 Kickstart re-activation key for  .
	usage_limit:	 0

	key:	         re-1-3b732ee74a14884a29bb6c9c5c039fc9
	description:	 Kickstart re-activation key for dhcp235.domain-example.com.
	usage_limit:	 1

	key:	         1-faecd4441330ef69c57dd28716cb95de
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-dd0e97fa66924ee5552c95c9b6a27aae
	description:	 Reactivation key for serverA.domain-example.com.
	usage_limit:	 0

	key:	         1-ef829f4593a0e165c6a113a2855eb8ed
	description:	 Automatically generated activation key.
	usage_limit:	 1

	key:	         re-1-5b8e39f66b65056e7abf41c4252d2a89
	description:	 Reactivation key for serverB.domain-example.com.
	usage_limit:	 0

Comment 1 Shannon Hughes 2012-04-23 20:53:36 UTC
Created attachment 579690 [details]
patch to show only custom activation keys

adding patch that fixes the issue marcello is describing

Comment 2 Tomas Lestach 2012-04-24 09:38:56 UTC
I do not like the idea that we make a activation_keys_for_org query and then for each entry another hibernate query to load the activation key (in the attached patch).

Fixing ...
spacewalk.git: 03030a6b2c92ff046f0aa197c36ed063b803bba4

Comment 3 Tomas Lestach 2012-04-24 09:39:12 UTC
I do not like the idea that we make a activation_keys_for_org query and then for each entry another hibernate query to load the activation key (in the attached patch).

Fixing ...
spacewalk.git: 03030a6b2c92ff046f0aa197c36ed063b803bba4

Comment 5 Shannon Hughes 2012-04-24 11:51:40 UTC
tomas, agree, your commit is a much cleaner approach. thanks for looking at this.

Comment 6 Jan Pazdziora 2012-10-30 19:22:41 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 7 Jan Pazdziora 2012-11-01 16:17:40 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18


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