Bug 959740 - [RFE] RHEVM-CLI: Prevent options that not in auto-completion from being specified
Summary: [RFE] RHEVM-CLI: Prevent options that not in auto-completion from being speci...
Keywords:
Status: CLOSED DUPLICATE of bug 885429
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Shai Revivo
URL:
Whiteboard: infra
Depends On: 885429
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-05 08:09 UTC by Ilia Meerovich
Modified: 2016-02-10 19:01 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-16 13:46:00 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 14539 0 None None None Never
oVirt gerrit 14540 0 None None None Never

Description Ilia Meerovich 2013-05-05 08:09:31 UTC
build sf15


[K[?1l>[RHEVM shell (connected)]# add permission --user-identifier 'a24a972c-8767-45eb-8bca-a8c74932446f'  --vm-origin 'rhev' --vm-placement_policy-affinity 'migratable' --vm-creation_time '2013-05-04T21:43:08.716+03:00' --vm-cluster-id '1b894275-4c93-4558-8da0-e23013b055d6' --vm-id '5a54c536-c91a-47bc-88ab-c026689ef061' --role-description 'User Role" with permission for any operation on Vms' --role-mutable false --role-administrative false --role-id 'def00006-0000-0000-0000-def000000006' --expect '201-created' --correlation_id 351 > /tmp/cli_output.tmp
[?1h=
send: 'GET /api/users/a24a972c-8767-45eb-8bca-a8c74932446f HTTP/1.1\r\nHost: jenkins-vm-28.scl.lab.tlv.redhat.com\r\nAccept-Encoding: identity\r\nFilter: False\r\ncookie: JSESSIONID=jA-NM7O4tFqqaRGgzMOTggDD\r\nPrefer: persistent-auth\r\nContent-type: application/xml\r\nAccept: application/xml\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Sat, 04 May 2013 18:44:44 GMT

header: Pragma: No-cache

header: Cache-Control: no-cache

header: Expires: Thu, 01 Jan 1970 02:00:00 IST

header: Content-Type: application/xml

header: Content-Length: 1032

header: Vary: Accept-Encoding

header: Connection: close

body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user href="/api/users/a24a972c-8767-45eb-8bca-a8c74932446f" id="a24a972c-8767-45eb-8bca-a8c74932446f">
    <name>istein</name>
    <link href="/api/users/a24a972c-8767-45eb-8bca-a8c74932446f/permissions" rel="permissions"/>
    <link href="/api/users/a24a972c-8767-45eb-8bca-a8c74932446f/roles" rel="roles"/>
    <link href="/api/users/a24a972c-8767-45eb-8bca-a8c74932446f/tags" rel="tags"/>
    <domain href="/api/domains/71612e6c-6162-2e74-6c76-2e7265646861" id="71612e6c-6162-2e74-6c76-2e7265646861">
        <name>qa.lab.tlv.redhat.com</name>
    </domain>
    <user_name>istein.tlv.redhat.com</user_name>
    <groups>
        <group>
            <name>qa.lab.tlv.redhat.com/QA-All-Users/RDP-Group</name>
        </group>
        <group>
            <name>qa.lab.tlv.redhat.com/QA-All-Users/LocalAdmins-Group</name>
        </group>
        <group>
            <name>qa.lab.tlv.redhat.com/QA-All-Users/QA-MembersGroup</name>
        </group>
    </groups>
</user>


[K[?1l>Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 188, in execute_string
    self._execute_command(command)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 295, in _execute_command
    command.run(self)
  File "/usr/lib/python2.6/site-packages/cli/command/command.py", line 100, in run
    self.execute()
  File "/usr/lib/python2.6/site-packages/ovirtcli/command/add.py", line 151, in execute
    result = self.execute_method(collection, 'add', opts)
  File "/usr/lib/python2.6/site-packages/ovirtcli/command/command.py", line 471, in execute_method
    result = method(**method_args)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/brokers.py", line 9346, in add
    body=ParseHelper.toXml(permission),
  File "/usr/lib/python2.6/site-packages/ovirtsdk/utils/parsehelper.py", line 35, in toXml
    entity.export(output, 0, name_=ParseHelper.getXmlTypeInstance(type_name))
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 9111, in export
    self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 9139, in exportChildren
    self.vm.export(outfile, level, namespace_, name_='vm', pretty_print=pretty_print)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 14225, in export
    self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 14271, in exportChildren
    outfile.write('<%screation_time>%s</%screation_time>%s' % (namespace_, self.gds_format_datetime(self.creation_time, input_name='creation_time'), namespace_, eol_))
  File "/usr/lib/python2.6/site-packages/ovirtsdk/xml/params.py", line 162, in gds_format_datetime
    if input_data.microsecond == 0:
AttributeError: 'str' object has no attribute 'microsecond'

Comment 1 Michael Pasternak 2013-05-05 11:49:45 UTC
caused by generateDS 2.9

Comment 3 Michael Pasternak 2013-05-06 08:14:35 UTC
--vm-creation_time is a read-only property that irrelevant to this context.

Comment 4 Michael Pasternak 2013-05-06 08:35:31 UTC
Ilia,

actuality fixing this bug means preventing options that are not in 
auto-completion

Comment 6 Oded Ramraz 2013-05-06 16:35:27 UTC
Raising the Severity / Priority since this issue affects automation tests , it's also seems like a regression in behavior from previous builds . 
Why do we need to prevent those options ? Can't we ignore them as before ?

Comment 7 Michael Pasternak 2013-05-07 06:07:29 UTC
(In reply to comment #6)
> Raising the Severity / Priority since this issue affects automation tests ,
> it's also seems like a regression in behavior from previous builds . 
> Why do we need to prevent those options ? Can't we ignore them as before ?

i tend to agree with you oded, there are a lot of well known implementations 
(such as XML for instance) that silently ignoring unknown elements,

if you don't have an option in auto-completion, don't invent it ... 

also blocking this will create another issue where not up to date SDK 
documentation, will block from cli to use new features.

Comment 8 Michael Pasternak 2013-05-07 09:33:34 UTC
for now added 'fail nicely patch' to file with cli internal error rather
standard python AttributeError

Comment 11 Juan Hernández 2014-06-16 13:46:00 UTC

*** This bug has been marked as a duplicate of bug 885429 ***


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