cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1283
Views
0
Helpful
0
Replies

Getting "RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.AttributeError'> ignored" error when adding a VLAN to a VLAN group with Python API

jonasstenling
Level 1
Level 1

Hello!

I have the following code to add a VLAN to a VLAN group:

def add_vlan_to_vlan_group(self, vlan, vlan_name, vlan_group):

        """Adding vlan to vlan group. Very important that vlan group

            name given is exactly the same as shown in UCSM """

        try:   

            self.handle.StartTransaction()

            self.obj = self.handle.GetManagedObject(None,

                UcsSdk.MoMeta.FabricLanCloud.FabricLanCloud.ClassId(),

                { UcsSdk.MoMeta.FabricLanCloud.FabricLanCloud.DN:'fabric/lan' })

            self.mo = self.handle.AddManagedObject(self.obj,

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.ClassId(),

                { UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.DESCR: vlan_name,

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.NAME: vlan_group,

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.NATIVE_NET: '',

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.POLICY_OWNER: 'local',

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.DN:

                    'fabric/lan/net-group-{vlan_group}'.format(

                        vlan_group = vlan_group),

                UcsSdk.MoMeta.FabricNetGroup.FabricNetGroup.TYPE: 'mgmt' },

                True)

            self.mo1 = self.handle.AddManagedObject(self.mo,

                UcsSdk.MoMeta.FabricPooledVlan.FabricPooledVlan.ClassId(),

                { UcsSdk.MoMeta.FabricPooledVlan.FabricPooledVlan.NAME: vlan_name,

                UcsSdk.MoMeta.FabricPooledVlan.FabricPooledVlan.DN:

                'fabric/lan/net-group-{vlan_group}/net-{vlan_name}'.format(

                    vlan_group = vlan_group, vlan_name = vlan_name)}, True)

            self.handle.CompleteTransaction()

            return True

        except:

            return False

This works flawlessly when called interactive. However, when I call this function from my automation script I get the following error message:

Adding VLAN 500 to 10.52.129.60...OK.

Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.AttributeError'> ignored

Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.AttributeError'> ignored

Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.AttributeError'> ignored

Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <type 'exceptions.AttributeError'> ignored

Adding VLAN 500 to VLAN group P3_Prod on 10.52.129.60...OK.

It still works, but I would like to not get this error message. As far as I can see I'm not doing any recursive calls in my code so I'm thinking that its somewhere in the Python SDK?

Thanks!

0 Replies 0

Review Cisco Networking for a $25 gift card

Review Cisco Networking for a $25 gift card