fmt
This commit is contained in:
parent
07ef08631d
commit
992196eca0
@ -79,8 +79,17 @@ def redeploy(app_record, deploy_record, deploy_crn, deployment_dir):
|
|||||||
version = "0.0.%d" % (int(deploy_record["attributes"]["version"].split(".")[-1]) + 1)
|
version = "0.0.%d" % (int(deploy_record["attributes"]["version"].split(".")[-1]) + 1)
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
"record": {"type": "WebAppDeploymentRecord", "version": version, "url": f"http://{hostname}", "name": hostname,
|
"record": {
|
||||||
"application": app_record["id"], "meta": {"config": config_hash(deployment_dir)}, }}
|
"type": "WebAppDeploymentRecord",
|
||||||
|
"version": version,
|
||||||
|
"url": f"http://{hostname}",
|
||||||
|
"name": hostname,
|
||||||
|
"application": app_record["id"],
|
||||||
|
"meta": {
|
||||||
|
"config": config_hash(deployment_dir)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tmpdir = tempfile.mkdtemp()
|
tmpdir = tempfile.mkdtemp()
|
||||||
try:
|
try:
|
||||||
@ -91,9 +100,9 @@ def redeploy(app_record, deploy_record, deploy_crn, deployment_dir):
|
|||||||
print(open(record_fname, 'r').read())
|
print(open(record_fname, 'r').read())
|
||||||
|
|
||||||
print("Updating deployment record ...")
|
print("Updating deployment record ...")
|
||||||
new_record_id = \
|
new_record_id = json.loads(
|
||||||
json.loads(cmd("laconic", "-c", args.laconic_config, "cns", "record", "publish", "--filename", record_fname))[
|
cmd("laconic", "-c", args.laconic_config, "cns", "record", "publish", "--filename", record_fname)
|
||||||
"id"]
|
)["id"]
|
||||||
print("Updating deployment registered name ...")
|
print("Updating deployment registered name ...")
|
||||||
cmd("laconic", "-c", args.laconic_config, "cns", "name", "set", deploy_crn, new_record_id)
|
cmd("laconic", "-c", args.laconic_config, "cns", "name", "set", deploy_crn, new_record_id)
|
||||||
finally:
|
finally:
|
||||||
@ -119,7 +128,7 @@ app_record = json.loads(cmd("laconic", "-c", args.laconic_config, "cns", "name",
|
|||||||
# compare
|
# compare
|
||||||
try:
|
try:
|
||||||
deploy_record = json.loads(cmd("laconic", "-c", args.laconic_config, "cns", "name", "resolve", args.deploy_crn))[0]
|
deploy_record = json.loads(cmd("laconic", "-c", args.laconic_config, "cns", "name", "resolve", args.deploy_crn))[0]
|
||||||
except:
|
except: # noqa: E722
|
||||||
deploy_record = {}
|
deploy_record = {}
|
||||||
|
|
||||||
needs_update = False
|
needs_update = False
|
||||||
|
1
stack_orchestrator/data/scripts/requirements.txt
Normal file
1
stack_orchestrator/data/scripts/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
PyYAML>=6.0.1
|
Loading…
Reference in New Issue
Block a user