NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

Python Discussions

Node Management IP Address

Mogley766
5,846 Views

Does anyone have any idea why the following code snipit would fail on a 4 node cluster, but work fine on a 2 node cluster?

 

 

# get node mangement interface info
nmgmtipresults = con.invoke("net-interface-get-iter").child_get("attributes-list").children_get()

 

# create empty list for node management interface
nmgmtip = []

 

# loop through attributes and get the ones wanted
for nmitem in nmgmtipresults:

    # get role
    nmrole = nmitem.child_get_string("role")

 

    # node management ips
    if(nmrole == "node_mgmt"):
        nmgmtip.append(nmitem.child_get_string("address"))

 

try:
    for m in nmgmtip:
        print "ip: "+m

except Exception, e:
    print e

 

When I run it against a 4 node cluster, I don't get any output.

 

Thanks.

1 ACCEPTED SOLUTION

Mogley766
5,820 Views
1 REPLY 1

Mogley766
5,821 Views

This post solved it for me:

 

https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/td-p/121805

 

I needed to add the "max-records" to get the full list of IP address's returned.

Public