]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add unit.meta for agent 44485/head
authorAdam King <adking@redhat.com>
Thu, 6 Jan 2022 12:42:35 +0000 (07:42 -0500)
committerAdam King <adking@redhat.com>
Thu, 6 Jan 2022 12:42:35 +0000 (07:42 -0500)
Signed-off-by: Adam King <adking@redhat.com>
src/cephadm/cephadm

index ca7cb5831c3bf144f30fe5b895511084694d98aa..6134b5d88032520453bcdb0ef3a745048c73313e 100755 (executable)
@@ -3787,6 +3787,12 @@ class CephadmAgent():
         with open(os.open(os.path.join(self.daemon_dir, 'unit.run'), os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
             f.write(self.unit_run())
 
+        meta: Dict[str, Any] = {}
+        if 'meta_json' in self.ctx and self.ctx.meta_json:
+            meta = json.loads(self.ctx.meta_json) or {}
+        with open(os.open(os.path.join(self.daemon_dir, 'unit.meta'), os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
+            f.write(json.dumps(meta, indent=4) + '\n')
+
         unit_file_path = os.path.join(self.ctx.unit_dir, self.unit_name())
         with open(os.open(unit_file_path + '.new', os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
             f.write(self.unit_file())