Bug 1110366 - RHEVM-CLI: wrong value recognition when string contains both characters and ip address
Summary: RHEVM-CLI: wrong value recognition when string contains both characters and i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Nelly Credi
URL:
Whiteboard: infra
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-06-17 13:51 UTC by Ilia Meerovich
Modified: 2016-02-10 19:41 UTC (History)
8 users (show)

Fixed In Version: rhevm-cli-3.5.0.3-1.el6_5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-11 18:10:27 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0185 0 normal SHIPPED_LIVE rhevm-cli bug fix and enhancement update 2015-02-11 22:39:13 UTC
oVirt gerrit 29722 0 master MERGED cli: No regular expression for IP, UUID or number Never
oVirt gerrit 31710 0 cli_3.5 MERGED cli: No regular expression for IP, UUID or number Never

Description Ilia Meerovich 2014-06-17 13:51:11 UTC
imeerovi@imeerovi ~/git/ART (master) $ rhevm-shell 


  =========================================================================================================================================================================================================================================
                                                                                                    >>> connected to RHEVM manager 3.4.0.0 <<<
  =========================================================================================================================================================================================================================================

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                                                                                                           Welcome to RHEVM shell

  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


[RHEVM shell (connected)]# list hosts 

id         : 800c5ed9-35be-49f6-b427-edaa92f9ac1b                                                                                                                                                                                            
name       : 10.35.102.103                                                                                                                                                                              
[RHEVM shell (connected)]# update host 10.35.102.103 --name 10.35.102.103foo
  ================================================================================================================== ERROR ================================================================================================================
                                                                                           wrong number of arguments, try 'help update' for help.
  =========================================================================================================================================================================================================================================

[RHEVM shell (connected)]# update host 10.35.102.103 --name '10.35.102.103foo'

id                                   : 800c5ed9-35be-49f6-b427-edaa92f9ac1b                                                                                                                                                                  
name                                 : 10.35.102.103foo                                                                                                                                                                                      
address                              : 10.35.102.103                                                                                                                                                                                         
certificate-organization             : qa.lab.tlv.redhat.com                                                                                                                                                                                 
certificate-subject                  : O=qa.lab.tlv.redhat.com,CN=10.35.102.103                                                                                                                                                              
cluster-id                           : 00000001-0001-0001-0001-000000000035                                                                                                                                                                  
cpu-name                             : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz                                                                                                                                                       
cpu-speed                            : 2394.0                                                                                                                                                                                                
cpu-topology-cores                   : 4                                                                                                                                                                                                     
cpu-topology-sockets                 : 1                                                                                                                                                                                                     
cpu-topology-threads                 : 2                                                                                                                                                                                                     
hardware_information-family          : System x                                                                                                                                                                                              
hardware_information-manufacturer    : IBM                                                                                                                                                                                                   
hardware_information-product_name    : BladeCenter HS22 -[7870K4G]-                                                                                                                                                                          
hardware_information-serial_number   : 06GY780                                                                                                                                                                                               
hardware_information-uuid            : 0bacebfc-ee0d-11df-89ea-e41f13cc3360                                                                                                                                                                  
hardware_information-version         : 07                                                                                                                                                                                                    
iscsi-initiator                      : iqn.1994-05.com.redhat:943a13e936c1                                                                                                                                                                   
ksm-enabled                          : False                                                                                                                                                                                                 
libvirt_version-build                : 2                                                                                                                                                                                                     
libvirt_version-full_version         : libvirt-0.10.2-29.el6_5.5                                                                                                                                                                             
libvirt_version-major                : 0                                                                                                                                                                                                     
libvirt_version-minor                : 10                                                                                                                                                                                                    
libvirt_version-revision             : 0                                                                                                                                                                                                     
max_scheduling_memory                : 16307453952                                                                                                                                                                                           
memory                               : 16712204288                                                                                                                                                                                           
os-type                              : RHEL                                                                                                                                                                                                  
os-version-full_version              : 6Server - 6.5.0.1.el6                                                                                                                                                                                 
port                                 : 54321                                                                                                                                                                                                 
power_management-automatic_pm_enabled: True                                                                                                                                                                                                  
power_management-enabled             : False                                                                                                                                                                                                 
power_management-type                : apc                                                                                                                                                                                                   
ssh-fingerprint                      : 79:9c:ce:ba:14:e7:e9:da:51:7a:54:24:c6:b4:3e:f4                                                                                                                                                       
ssh-port                             : 22                                                                                                                                                                                                    
status-state                         : up                                                                                                                                                                                                    
storage_manager-priority             : 5                                                                                                                                                                                                     
storage_manager-valueOf              : false                                                                                                                                                                                                 
summary-active                       : 0                                                                                                                                                                                                     
summary-migrating                    : 0                                                                                                                                                                                                     
summary-total                        : 0                                                                                                                                                                                                     
transparent_hugepages-enabled        : True                                                                                                                                                                                                  
type                                 : rhel                                                                                                                                                                                                  
version-build                        : 5                                                                                                                                                                                                     
version-full_version                 : vdsm-4.14.5-0.1.beta2.el6ev                                                                                                                                                                           
version-major                        : 4                                                                                                                                                                                                     
version-minor                        : 14                                                                                                                                                                                                    
version-revision                     : 0                                                                                                                                                                                                     

[RHEVM shell (connected)]# update host 10.35.102.103foo --name foo
  ================================================================================================================== ERROR ================================================================================================================
                                                                                           wrong number of arguments, try 'help update' for help.
  =========================================================================================================================================================================================================================================

[RHEVM shell (connected)]# update host '10.35.102.103foo' --name foo

id                                   : 800c5ed9-35be-49f6-b427-edaa92f9ac1b                                                                                                                                                                  
name                                 : foo                                                                                                                                                                                                   
address                              : 10.35.102.103                                                                                                                                                                                         
certificate-organization             : qa.lab.tlv.redhat.com                                                                                                                                                                                 
certificate-subject                  : O=qa.lab.tlv.redhat.com,CN=10.35.102.103                                                                                                                                                              
cluster-id                           : 00000001-0001-0001-0001-000000000035                                                                                                                                                                  
cpu-name                             : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz                                                                                                                                                       
cpu-speed                            : 2394.0                                                                                                                                                                                                
cpu-topology-cores                   : 4                                                                                                                                                                                                     
cpu-topology-sockets                 : 1                                                                                                                                                                                                     
cpu-topology-threads                 : 2                                                                                                                                                                                                     
hardware_information-family          : System x                                                                                                                                                                                              
hardware_information-manufacturer    : IBM                                                                                                                                                                                                   
hardware_information-product_name    : BladeCenter HS22 -[7870K4G]-                                                                                                                                                                          
hardware_information-serial_number   : 06GY780                                                                                                                                                                                               
hardware_information-uuid            : 0bacebfc-ee0d-11df-89ea-e41f13cc3360                                                                                                                                                                  
hardware_information-version         : 07                                                                                                                                                                                                    
iscsi-initiator                      : iqn.1994-05.com.redhat:943a13e936c1                                                                                                                                                                   
ksm-enabled                          : False                                                                                                                                                                                                 
libvirt_version-build                : 2                                                                                                                                                                                                     
libvirt_version-full_version         : libvirt-0.10.2-29.el6_5.5                                                                                                                                                                             
libvirt_version-major                : 0                                                                                                                                                                                                     
libvirt_version-minor                : 10                                                                                                                                                                                                    
libvirt_version-revision             : 0                                                                                                                                                                                                     
max_scheduling_memory                : 16307453952                                                                                                                                                                                           
memory                               : 16712204288                                                                                                                                                                                           
os-type                              : RHEL                                                                                                                                                                                                  
os-version-full_version              : 6Server - 6.5.0.1.el6                                                                                                                                                                                 
port                                 : 54321                                                                                                                                                                                                 
power_management-automatic_pm_enabled: True                                                                                                                                                                                                  
power_management-enabled             : False                                                                                                                                                                                                 
power_management-type                : apc                                                                                                                                                                                                   
ssh-fingerprint                      : 79:9c:ce:ba:14:e7:e9:da:51:7a:54:24:c6:b4:3e:f4                                                                                                                                                       
ssh-port                             : 22                                                                                                                                                                                                    
status-state                         : up                                                                                                                                                                                                    
storage_manager-priority             : 5                                                                                                                                                                                                     
storage_manager-valueOf              : false                                                                                                                                                                                                 
summary-active                       : 0                                                                                                                                                                                                     
summary-migrating                    : 0                                                                                                                                                                                                     
summary-total                        : 0                                                                                                                                                                                                     
transparent_hugepages-enabled        : True                                                                                                                                                                                                  
type                                 : rhel                                                                                                                                                                                                  
version-build                        : 5                                                                                                                                                                                                     
version-full_version                 : vdsm-4.14.5-0.1.beta2.el6ev                                                                                                                                                                           
version-major                        : 4                                                                                                                                                                                                     
version-minor                        : 14                                                                                                                                                                                                    
version-revision                     : 0                                                                                                                                                                                                     

[RHEVM shell (connected)]# update host foo --name 10.35.102.103

id                                   : 800c5ed9-35be-49f6-b427-edaa92f9ac1b                                                                                                                                                                  
name                                 : 10.35.102.103                                                                                                                                                                                         
address                              : 10.35.102.103                                                                                                                                                                                         
certificate-organization             : qa.lab.tlv.redhat.com                                                                                                                                                                                 
certificate-subject                  : O=qa.lab.tlv.redhat.com,CN=10.35.102.103                                                                                                                                                              
cluster-id                           : 00000001-0001-0001-0001-000000000035                                                                                                                                                                  
cpu-name                             : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz                                                                                                                                                       
cpu-speed                            : 2394.0                                                                                                                                                                                                
cpu-topology-cores                   : 4                                                                                                                                                                                                     
cpu-topology-sockets                 : 1                                                                                                                                                                                                     
cpu-topology-threads                 : 2                                                                                                                                                                                                     
hardware_information-family          : System x                                                                                                                                                                                              
hardware_information-manufacturer    : IBM                                                                                                                                                                                                   
hardware_information-product_name    : BladeCenter HS22 -[7870K4G]-                                                                                                                                                                          
hardware_information-serial_number   : 06GY780                                                                                                                                                                                               
hardware_information-uuid            : 0bacebfc-ee0d-11df-89ea-e41f13cc3360                                                                                                                                                                  
hardware_information-version         : 07                                                                                                                                                                                                    
iscsi-initiator                      : iqn.1994-05.com.redhat:943a13e936c1                                                                                                                                                                   
ksm-enabled                          : False                                                                                                                                                                                                 
libvirt_version-build                : 2                                                                                                                                                                                                     
libvirt_version-full_version         : libvirt-0.10.2-29.el6_5.5                                                                                                                                                                             
libvirt_version-major                : 0                                                                                                                                                                                                     
libvirt_version-minor                : 10                                                                                                                                                                                                    
libvirt_version-revision             : 0                                                                                                                                                                                                     
max_scheduling_memory                : 16307453952                                                                                                                                                                                           
memory                               : 16712204288                                                                                                                                                                                           
os-type                              : RHEL                                                                                                                                                                                                  
os-version-full_version              : 6Server - 6.5.0.1.el6                                                                                                                                                                                 
port                                 : 54321                                                                                                                                                                                                 
power_management-automatic_pm_enabled: True                                                                                                                                                                                                  
power_management-enabled             : False                                                                                                                                                                                                 
power_management-type                : apc                                                                                                                                                                                                   
ssh-fingerprint                      : 79:9c:ce:ba:14:e7:e9:da:51:7a:54:24:c6:b4:3e:f4                                                                                                                                                       
ssh-port                             : 22                                                                                                                                                                                                    
status-state                         : up                                                                                                                                                                                                    
storage_manager-priority             : 5                                                                                                                                                                                                     
storage_manager-valueOf              : false                                                                                                                                                                                                 
summary-active                       : 0                                                                                                                                                                                                     
summary-migrating                    : 0                                                                                                                                                                                                     
summary-total                        : 0                                                                                                                                                                                                     
transparent_hugepages-enabled        : True                                                                                                                                                                                                  
type                                 : rhel                                                                                                                                                                                                  
version-build                        : 5                                                                                                                                                                                                     
version-full_version                 : vdsm-4.14.5-0.1.beta2.el6ev                                                                                                                                                                           
version-major                        : 4                                                                                                                                                                                                     
version-minor                        : 14                                                                                                                                                                                                    
version-revision                     : 0                                                                                                                                                                                                     

[RHEVM shell (connected)]# 

It happens because of wrong regex for IP address that will also extract IP from string like 10.35.102.103foo (src/cli/parser.py):
 def t_IPADDR(self, t):
        # ip validity check performed on the server side,
        # this pattern only recognizes the IP address form
        r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
        t.value = str(t.value)
        return t

Comment 1 Juan Hernández 2014-06-17 14:18:49 UTC
Actually that regular expression and the IPADDR terminal symbol are mostly useless, as we don't do any validation in the CLI and the productions of the grammar that use that terminal symbol also accept WORD, whose regular expression is a superset of IPADDR. Same for UUID.

Comment 2 Nelly Credi 2014-09-16 13:07:26 UTC
Verified in vt3.1

Comment 4 errata-xmlrpc 2015-02-11 18:10:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0185.html


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