i m trying to pull the aggr space using below script and getting hte error.Cna some one help me plz.
Error:
File "5_aggrstatuinfo.py", line 34, in <module>
for aggrs in aggr_list.children_get():
AttributeError: 'NoneType' object has no attribute 'children_get'
Code:
from NaServer import *
obj = NaServer(“IPaddress”,1,150)
obj.set_server_type("FILER")
obj.set_transport_type("HTTPS")
obj.set_port("443")
obj.set_style("LOGIN")
obj.set_admin_user("admin”,”XXXXXXXX”)
api = NaElement("aggr-space-get-iter")
#xo = NaElement("desired-attributes")
#api.child_add(xo)
xi = NaElement("query")
api.child_add(xi)
xo1 = NaElement("space-information")
xi.child_add(xo1)
xo1.child_add_string("aggregate","<aggregate-Name>")
xo1.child_add_string("aggregate-size","<aggregate-size>")
xo1.child_add_string("physical-used","<physical-used>")
xo1.child_add_string("physical-used-percentage","<physical-used-percentage>")
out= obj.invoke_elem(api)
aggr_list = out.child_get("aggregates")
if (out.results_status == "failed"):
print("error\n")
print(out.sprintf())
sys.exit()
for aggrs in aggr_list.children_get():
print("a\n")
print ('name {} {}'.format(aggr.child_get_string("aggregate"),aggr.child_get_string("physical-used")))