Bug 811658

Summary: activationkey_create
Product: [Community] Spacewalk Reporter: Daniel Forsberg <daniel.forsberg>
Component: ServerAssignee: Aron Parsons <parsonsa>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.8CC: msuchy, parsonsa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-12 15:11:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 871344    

Description Daniel Forsberg 2012-04-11 16:08:06 UTC
Description of problem:
activationkey_create function does not take its options 

$ spacecmd help activationkey_create
activationkey_create: Create an activation key
usage: activationkey_create [options]

options:
  -n NAME
  -d DESCRIPTION
  -b BASE_CHANNEL
  -u set key as universal default
  -e [provisioning_entitled,enterprise_entitled,monitoring_entitled,
      virtualization_host,virtualization_host_platform]

$ spacecmd activationkey_create -n test
usage: spacecmd [options] [command]

spacecmd: error: no such option: -n


Version-Release number of selected component (if applicable):
spacecmd-1.2.2-1.el5

How reproducible:
spacecmd activationkey_create -n test

Steps to Reproduce:
1. spacecmd activationkey_create -n testkey
2.
3.
  
Actual results:
usage: spacecmd [options] [command]

spacecmd: error: no such option: -n


Expected results:

INFO: Created activation key 1-testkey

Additional info:

tested on RHEL-5.7 X86_64

have tried with more options with same result...

Comment 1 Miroslav Suchý 2012-04-12 08:09:56 UTC
Aron, can you check if this is fixed in some recent spacecmd and we need "just" to rebase it epel5 or if it present even in recent spacecmd?

Comment 2 Daniel Forsberg 2012-04-12 08:30:53 UTC
Hi,

Notised that no - or -- input works at all...

Comment 3 Daniel Forsberg 2012-04-12 10:10:28 UTC
Tested with spacecmd-1.8.3-1.el5.noarch.rpm 
from here: http://spacewalk.redhat.com/yum/nightly/RHEL/5/x86_64/

Same result...

Comment 4 Miroslav Suchý 2012-04-12 10:20:10 UTC
In such case forwarding to upstream.

Comment 5 Daniel Forsberg 2012-04-12 10:55:40 UTC
can it be some kind of python dependancy problem?

Comment 6 Aron Parsons 2012-04-12 15:11:07 UTC
Please see the "RUNNING SINGLE COMMANDS" section of the man page.  We use the 'optparse' module once for the main spacecmd options and then again for each sub-command.  When running a single command, you need to tell it to stop parsing arguments before the sub-command.

[root@spacewalk spacewalk]# rpm -q spacecmd
spacecmd-1.7.7-1.el6.noarch

[root@spacewalk ~]# spacecmd activationkey_create -n asdf
Usage: spacecmd [options] [command]

spacecmd: error: no such option: -n

[root@spacewalk ~]# spacecmd -- activationkey_create -n asdf
INFO: Connected to https://localhost/rpc/api as admin
INFO: Created activation key 1-asdf