[ODLTOOLS-19] odltools 'netvirt' command options are getting failed due to exception. Created: 03/Oct/18  Updated: 13/Nov/18  Resolved: 13/Nov/18

Status: Done
Project: odltools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: BALASARITHA R Assignee: Vishal Thapar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

With the latest odltools, the following exception is seen while executing the command ‘python -m odltools netvirt show neutron all’

The RestClient is not getting initialized from method ‘get_models(self, args, models)’ in mdsal/models/models.py

All netvirt command options are getting failed for the same reason. 

stack@osc-pike-ubuntu16:~/odltools$ python -m odltools netvirt show neutron all
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
 "_main_", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
 exec code in run_globals
File "/home/stack/odltools/odltools/_main_.py", line 17, in <module>
 main()
File "/home/stack/odltools/odltools/_main_.py", line 13, in main
 cli.main()
File "odltools/cli.py", line 46, in main
 args.func(args)
File "odltools/netvirt/show.py", line 187, in show_neutron
 config.get_models(args, {"neutron_neutron"})
File "odltools/netvirt/config.py", line 26, in get_models
 gmodels.get_models(args, models)
File "odltools/mdsal/models/models.py", line 119, in get_models
 self.neutron_neutron = neutron.neutron(Model.CONFIG, args)
File "odltools/mdsal/models/neutron.py", line 13, in neutron
 return Neutron(MODULE, store, args)
File "odltools/mdsal/models/model.py", line 38, in _init_
 self.data = get_model_data(self.data, self.filename, self.url, args)
File "odltools/mdsal/models/model.py", line 158, in get_model_data
 data = get_from_odl(url)
File "odltools/mdsal/models/model.py", line 147, in get_from_odl
 return odl_client.get_json(url)
 AttributeError: 'NoneType' object has no attribute 'get_json'

 

 



 Comments   
Comment by Vishal Thapar [ 08/Oct/18 ]

As part of https://git.opendaylight.org/gerrit/76233 the rest methods were refactored. This led to a missing call to init_rest_client for all cases other than 'odltools model get' because call path to get models was changed for the model get and other use cases which only pull specific models on need basis.

Generated at Wed Feb 07 20:28:19 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.