UCSM should strip domain names from config files so it works with CVD

Bug #1655044 reported by Carol Bouchard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-cisco
New
Undecided
Unassigned

Bug Description

While getting CVD2 (OSP8) working, I had pulled in the RH patch for Nexus and UCSM. However, the patch
https://review.openstack.org/#/c/360708/
for UCSM was not complete enough for CVD2 to succeed. I had added a hack file to the build in order
to get things working. This hack file stripped the domain name from the configuration files.
At this time, the hack file exists in osp7_install branch in the name
osp7_installer/ansible/roles/osp-overcloud-image/templates/diff_ucsm_hack.patch

I refer to it as a hack file since Sandhya wanted to add more intelligence to the final solution.
The hack file currently contains the following:

diff --git a/networking_cisco/plugins/ml2/drivers/cisco/ucsm/config.py b/networking_cisco/plugins/ml2/drivers/cisco/ucsm/config.py
index 748a145..44b1137 100644
--- a/networking_cisco/plugins/ml2/drivers/cisco/ucsm/config.py
+++ b/networking_cisco/plugins/ml2/drivers/cisco/ucsm/config.py
@@ -89,7 +89,8 @@ def parse_ucsm_host_config():
             if not sep or not service_profile:
                 raise cfg.Error(_("UCS Mech Driver: Invalid Host Service "
                                   "Profile config: %s") % host)
- key = (cfg.CONF.ml2_cisco_ucsm.ucsm_ip, hostname)
+ short_hostname = hostname.split('.')[0]
+ key = (cfg.CONF.ml2_cisco_ucsm.ucsm_ip, short_hostname)
             if '/' not in service_profile:
                 # Assuming the service profile is at the root level
                 # and the path is not specified. This option
@@ -104,8 +105,8 @@ def parse_ucsm_host_config():
                 sp_dict[key] = service_profile.strip()

             LOG.debug('Service Profile for %s is %s',
- hostname, sp_dict.get(key))
- host_dict[hostname] = cfg.CONF.ml2_cisco_ucsm.ucsm_ip
+ short_hostname, sp_dict.get(key))
+ host_dict[short_hostname] = cfg.CONF.ml2_cisco_ucsm.ucsm_ip
         return sp_dict, host_dict

Tags: ucsm
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.