Skip to content

Commit

Permalink
Minor fix for volttron-upgrade command (#3038)
Browse files Browse the repository at this point in the history
* fix for issue #3035

* renamed script used to stop agent running in isolation mode

* Fix for issue #3037

* using pathlib.Path instead of os path
  • Loading branch information
schandrika authored Sep 30, 2022
1 parent 9aee805 commit 342fa9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions volttron/platform/upgrade/move_sqlite_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY
# under Contract DE-AC05-76RL01830
# }}}

import sys
import shutil
from pathlib import Path
Expand All @@ -59,11 +58,6 @@ def get_aip():


def move_historian_cache_files(aip):
"""
Moves any keystore.json from agent-data to dist-info.
Only applies to agents in auth file.
"""

vhome = Path(aip.env.volttron_home)
install_dir = vhome.joinpath("agents")
# pattern example - (/vhome/agents/uuid/agentname-version/)(backup.sqlite)
Expand Down Expand Up @@ -94,8 +88,11 @@ def move_historian_cache_files(aip):


def main():
"""Upgrade auth file to function with dynamic rpc authorizations"""

"""Moves backup cache of historian (backup.sqlite files) into corresponding agent-data directory"""
install_dir = Path(get_home()).joinpath("agents")
if not install_dir.exists():
print("No historians to upgrade")
return
fail_if_instance_running()
aip = get_aip()
move_historian_cache_files(aip)
Expand Down
7 changes: 5 additions & 2 deletions volttron/platform/upgrade/update_auth_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY
# under Contract DE-AC05-76RL01830
# }}}

import sys
import shutil
from pathlib import Path
Expand Down Expand Up @@ -141,7 +140,11 @@ def set_auth_identities(agent_credential_map):

def main():
"""Upgrade auth file to function with dynamic rpc authorizations"""

vhome = Path(get_home())
install_dir = vhome.joinpath("agents")
if not install_dir.exists():
print("No installed agents for auth update.")
return
fail_if_instance_running()
aip = get_aip()
upgrade_old_agents(aip)
Expand Down

0 comments on commit 342fa9c

Please sign in to comment.