Skip to content

Commit

Permalink
Rock-on install back-end - add per-container env info rockstor#1588
Browse files Browse the repository at this point in the history
Add back-end container dimension awareness re environment
passed from Rock-on install wizard. Rebase of earlier work
cheery picked/re-based from anatox's prior work on GitHub.
  • Loading branch information
phillxnet committed Aug 12, 2024
1 parent 3447bef commit 391e85a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/rockstor/storageadmin/views/rockon_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def post(self, request, rid, command):
)
containers = DContainer.objects.filter(rockon=rockon)
for co in containers:
co_id = str(co.id)
for sname in share_map.keys():
dest_dir = share_map[sname]
if not Share.objects.filter(name=sname).exists():
Expand Down Expand Up @@ -177,15 +178,16 @@ def post(self, request, rid, command):
cco = DCustomConfig.objects.get(rockon=rockon, key=c)
cco.val = cc_map[c]
cco.save()
for e in env_map.keys():
if not DContainerEnv.objects.filter(
container=co, key=e
).exists():
e_msg = ("Invalid environment variable ({}).").format(e)
handle_exception(Exception(e_msg), request)
ceo = DContainerEnv.objects.get(container=co, key=e)
ceo.val = env_map[e]
ceo.save()
if co_id in env_map:
for e in env_map[co_id].keys():
if not DContainerEnv.objects.filter(
container=co, key=e
).exists():
e_msg = ("Invalid environment variable ({}).").format(e)
handle_exception(Exception(e_msg), request)
ceo = DContainerEnv.objects.get(container=co, key=e)
ceo.val = env_map[co_id][e]
ceo.save()
task_result_handle = install(rockon.id)
rockon.taskid = task_result_handle.id
rockon.state = "pending_install"
Expand Down

0 comments on commit 391e85a

Please sign in to comment.