volttron-upgrade command fails when no agents are installed in current volttron home
schandrika opened this issue · comments
volttron-upgrade command fails when no agents are installed in current volttron home
(volttron) volttron@volttron1:~/git/volttron_develop$ volttron-upgrade
Traceback (most recent call last):
File "/home/volttron/git/volttron_develop/env/bin/volttron-upgrade", line 11, in
load_entry_point('volttron', 'console_scripts', 'volttron-upgrade')()
File "/home/volttron/git/volttron_develop/volttron/platform/upgrade/upgrade_volttron.py", line 66, in _main
sys.exit(main())
File "/home/volttron/git/volttron_develop/volttron/platform/upgrade/upgrade_volttron.py", line 50, in main
update_auth_file.main()
File "/home/volttron/git/volttron_develop/volttron/platform/upgrade/update_auth_file.py", line 147, in main
upgrade_old_agents(aip)
File "/home/volttron/git/volttron_develop/volttron/platform/upgrade/update_auth_file.py", line 85, in upgrade_old_agents
agent_map = aip.get_agent_identity_to_uuid_mapping()
File "/home/volttron/git/volttron_develop/volttron/platform/aip.py", line 633, in get_agent_identity_to_uuid_mapping
for agent_uuid in self.list_agents():
File "/home/volttron/git/volttron_develop/volttron/platform/aip.py", line 710, in list_agents
for agent_uuid in os.listdir(self.install_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/home/volttron/t3/agents'
Everything you added with os can be accomplished with .exists() from path
Path().exists() then no import of os is necessary.