Skip to content

Commit

Permalink
Work in progress for idaholab#287
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Nov 13, 2023
1 parent 99afed6 commit 9b1253a
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion scripts/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,18 @@ def netboxRestore(backupFileName=None):
f'{uidGidDict["PUID"]}:{uidGidDict["PGID"]}',
]

# if the netbox_init.py process is happening, interrupt it
# stop the netbox processes
dockerCmd = dockerCmdBase + [
'netbox',
'supervisorctl',
'stop',
'netbox:*',
]
err, results = run_process(dockerCmd, env=osEnv, debug=args.debug)
if (err != 0) and args.debug:
eprint(f'Error stopping netbox:*: {results}')

# if the netbox_init.py process is still happening, interrupt it
dockerCmd = dockerCmdBase + [
'netbox',
'bash',
Expand Down Expand Up @@ -628,6 +639,19 @@ def netboxRestore(backupFileName=None):
if (err != 0) or (len(results) == 0):
raise Exception('Error loading NetBox database')

# start back up the netbox processes
dockerCmd = dockerCmdBase + [
'netbox',
'supervisorctl',
'start',
'netbox:housekeeping',
'netbox:main',
'netbox:worker',
]
err, results = run_process(dockerCmd, env=osEnv, debug=args.debug)
if (err != 0) and args.debug:
eprint(f'Error starting netbox:*: {results}')

# migrations if needed
dockerCmd = dockerCmdBase + ['netbox', '/opt/netbox/netbox/manage.py', 'migrate']
err, results = run_process(dockerCmd, env=osEnv, debug=args.debug)
Expand Down

0 comments on commit 9b1253a

Please sign in to comment.