CiscoFCSanLookupService uses extra argument in the __init__ routine

Bug #1385974 reported by Xing Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Xing Yang

Bug Description

Got the following error message when testing attach volume using Cisco switches.

2014-10-22 12:24:04.355 DEBUG cinder.zonemanager.fc_san_lookup_service [req-31e590b9-d9ff-4659-a2d2-1490e662d09e b58f3b9456e3464e8376eb25d5c40edb ecc06b248db44562af5599dab17bea56] Lookup service to invoke: cinder.zonemanager.drivers.cisco.cisco_fc_san_lookup_service.CiscoFCSanLookupService from (pid=24606) get_device_mapping_from_network /opt/stack/cinder/cinder/zonemanager/fc_san_lookup_service.py:79
2014-10-22 12:24:04.391 ERROR cinder.volume.manager [req-31e590b9-d9ff-4659-a2d2-1490e662d09e b58f3b9456e3464e8376eb25d5c40edb ecc06b248db44562af5599dab17bea56] Unable to fetch connection information from backend: __init__() takes exactly 1 argument (3 given)
2014-10-22 12:24:04.392 ERROR oslo.messaging.rpc.dispatcher [req-31e590b9-d9ff-4659-a2d2-1490e662d09e b58f3b9456e3464e8376eb25d5c40edb ecc06b248db44562af5599dab17bea56] Exception during message handling: Bad or unexpected response from the storage volume backend API: Unable to fetch connection information from backend: __init__() takes exactly 1 argument (3 given)

Here is the code in /cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py

    def __init__(self, **kwargs):
        """Initializing the client."""
        super(CiscoFCSanLookupService, self).__init__(self, **kwargs)
        self.configuration = kwargs.get('configuration', None)
        self.create_configuration()

        self.switch_user = ""
        self.switch_port = ""
        self.switch_pwd = ""
        self.switch_ip = ""
        self.sshpool = None

        self.fabric_configs = ""

There are two issues with this __init__ routine:

1. There's an extra argument in super(CiscoFCSanLookupService, self).__init__(self, **kwargs). It should be changed to super(CiscoFCSanLookupService, self).__init__(**kwargs).

2. The last line 'self.fabric_configs = ""' should be removed. self.fabric_configs was created in self.create_configuration() in the middle of the __init__ routine. It shouldn't be cleared out at the end of the __init__ routine.

Xing Yang (xing-yang)
Changed in cinder:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Xing Yang (xing-yang)
Xing Yang (xing-yang)
tags: added: cisco zonemanager
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/130997

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

Reviewed: https://review.openstack.org/130997
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=5cc9d0cffa44467051bdc01d64b889277d149359
Submitter: Jenkins
Branch: master

commit 5cc9d0cffa44467051bdc01d64b889277d149359
Author: Xing Yang <email address hidden>
Date: Sun Oct 26 17:29:26 2014 -0400

    CiscoFCSanLookupSerive uses extra argument in init

    This patch fixed two issues with the __init__ routine in
    CiscoFCSanLookupService:

    1. There's an extra argument in super(CiscoFCSanLookupService,
    self).__init__(self, **kwargs). It should be changed to
    super(CiscoFCSanLookupService, self).__init__(**kwargs).

    2. The last line 'self.fabric_configs = ""' should be removed.
    self.fabric_configs was created in self.create_configuration() in the
    middle of the __init__ routine. It shouldn't be cleared out at the end
    of the __init__ routine.

    Change-Id: I2623f3b51af34d14849015e52e3676271c9fe414
    Closes-Bug: #1385974

Changed in cinder:
status: In Progress → Fix Committed
Mike Perez (thingee)
Changed in cinder:
milestone: none → kilo-1
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-1 → 2015.1.0
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.