Complete enroll route

This commit is contained in:
2024-07-02 22:55:51 +02:00
parent e64a444bd0
commit 01ffe085d7
8 changed files with 121 additions and 23 deletions

View File

@@ -44,10 +44,14 @@ if not os.path.isfile(args.dev_csr_path):
f.write(csr)
print("Check device enrollment...")
if not os.path.isfile(args.dev_crt_path):
if not os.path.isfile(args.dev_enroll_marker):
with open(args.dev_csr_path, "r") as f:
csr = "".join(f.read())
print("Enrolling device...")
crt = api.enroll_device(csr)
print("res" + crt)
with open(args.dev_enroll_marker, "w") as f:
f.write("submitted")
# TODO : "intelligent" enrollment management (re-enroll if cancelled)