The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Software Development Kit (SDK) and API Discussions

python + SDK vserver info gives a error.

RaghavaCheruku

cat vserver_info1.py

#!/usr/bin/env python3

import sys

sys.path.append("/opt/netapp-manageability-sdk-9.4/lib/python/NetApp")

from NaServer import *

from getpass import getpass

 

def vserver_info(s):

    t1 = NaElement("vserver-get-iter")

    out = s.invoke_elem(t1)

    if (out.results_status() == "failed"):

        print("Error:\n")

        print(out.sprintf())

        sys.exit(1)

    #print(out.sprintf())

     

    info = dict()

    info = out.child_get("attributes-list")

    for info1 in info.children_get():

        print("vserver-Name: %s" % info1.child_get_string("vserver-name"))

        print("vserver-type: %s" % info1.child_get_string("vserver-type"))

        print("vserver state %s" % info1.child_get_string("state"))

        print("vserver-ipspace: %s" % info1.child_get_string("ipspace"))

        print("vserver root volume%s" % info1.child_get_string("root-volume"))

        print("vserver language: %s" % info1.child_get_string("language"))

        print("Vserver snapshot policy: %s" % info1.child_get_string("snapshot-policy"))

        pro = dict()

        pro = info1.child_get("allowed-protocols")

        for pro1 in pro.children_get():

            print("protocol enabled: %s" % pro1.child_get_string("protocol"))

 

def main():

 

    s = NaServer(filer, 1, 3)

    resp = s.set_style('LOGIN')

 

    if (resp and resp.results_errno() != 0):

        r = resp.results_reason()

        print("Failed to set authentication style " + r + "\n")

        sys.exit(2)

 

    s.set_admin_user(user, pw)

    resp = s.set_transport_type('HTTPS')

 

    if (resp and resp.results_errno() != 0):

        r = resp.results_reason()

        print("Unable to set HTTP transport " + r + "\n")

        sys.exit(2)

 

    vserver_info(s)

 

#args = len(sys.argv) - 1

 

#if (args < 2):

#    print_usage()

 

#filer = sys.argv[1]

#user = sys.argv[2]

#pw = getpass("please end the password :")

 

filer = 'netapp-bb98.labx.mo.sap.corp'

user = 'admin'

pw = 'netapp123'

 

main()

############################################################

when I execute the program,

#python3 vserver_info1.py

vserver-Name: Cluster

vserver-type: system

vserver state None

vserver-ipspace: Cluster

vserver root volumeNone

vserver language: None

Vserver snapshot policy: none

Traceback (most recent call last):

  File "vserver_info1.py", line 65, in <module>

    main()

  File "vserver_info1.py", line 50, in main

    vserver_info(s)

  File "vserver_info1.py", line 29, in vserver_info

    for pro1 in pro.children_get():

AttributeError: 'NoneType' object has no attribute 'children_get'

############################################################

can someone help me to understand whats wrong here.  how to fix the issue.

 

regards

Raghava.

0 REPLIES 0
Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public