EMC VMAX driver does not handle newlines and whitespace consistently in xml

Bug #1364232 reported by Carl Pecinovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Xing Yang

Bug Description

This is my first openstack bug report. I believe this should go to Xing Yang.

The EMC VMAX driver parses an XML config file (default is /etc/cinder/cinder_emc_config.xml) to retrieve different pieces of config information. The parsing helper methods are not consistent in their expectation of the format of this file.

For example, I provide a file with newlines and white-space like the following:

<?xml version="1.0" encoding="UTF-8"?>
<EMC>
  <EcomServerPort>5988
  </EcomServerPort>
  <Array>000198700498</Array>
  <EcomServerIp>5.55.55.5
  </EcomServerIp>
  <Pool>PowerVC_thin</Pool>
<EcomUserName>admin</EcomUserName><PortGroups><PortGroup>PORTGROUP1</PortGroup><PortGroup>PORTGROUP2</PortGroup></PortGroups></EMC>

This shows newlines and indenting for some properties, and no newlines or indenting for others.

Then, EMCVMAXUtils.get_ecom_server() will return:
    (u'5.55.55.5\n ', u'5988\n ')

Where the newlines and whitespace are included in the address and port strings. This causes the driver to fail.
If I take out the whitespace and newlines, then the IP address and port are parsed correctly. However, the portgroups are not parsed correctly if I remove whitespace and newlines as is shown in the last line of the file. In this case EMCVMAXUtils.parse_file_to_get_port_group_name() returns:

    u'PORTGROUP1PORTGROUP2'

Where it should return one of the port groups at random. Instead it munges the two together. Can the EMCVMAXUtils class be fixed to handle hand tolerate normal XML?

Tags: drivers
Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Xing Yang (xing-yang)
Jay Bryant (jsbryant)
tags: added: drivers
Xing Yang (xing-yang)
Changed in cinder:
status: New → In Progress
importance: Undecided → Medium
Xing Yang (xing-yang)
Changed in cinder:
milestone: none → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/121282

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/121282
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=6d59790b9cd42309417ae1866e40a06dcb557abe
Submitter: Jenkins
Branch: master

commit 6d59790b9cd42309417ae1866e40a06dcb557abe
Author: Xing Yang <email address hidden>
Date: Fri Sep 12 20:16:56 2014 -0400

    Handle config file with newlines and whitespaces

    EMC VMAX driver does not handle newlines and whitespaces
    consistently in the XML config file. This patch addressed
    this issue.

    Change-Id: I45f61f167feee9174ba2bc3229695b680f8e946d
    Closes-Bug: #1364232

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.