|
14 | 14 | import httpx |
15 | 15 | import zstandard |
16 | 16 | from DIRACCommon.Core.Utilities.ClassAd.ClassAdLight import ClassAd |
17 | | -from typer import FileText |
18 | 17 |
|
19 | 18 | from diracx.client.aio import AsyncDiracClient |
20 | 19 | from diracx.client.models import SandboxInfo |
@@ -128,22 +127,20 @@ async def download_sandbox(pfn: str, destination: Path, *, client: AsyncDiracCli |
128 | 127 |
|
129 | 128 |
|
130 | 129 | @with_client |
131 | | -async def submit_jobs(jdls: list[FileText], *, client: AsyncDiracClient): |
| 130 | +async def submit_jobs(jdls: list[str], *, client: AsyncDiracClient): |
132 | 131 | # Create and upload InputSandboxes from JDLs |
133 | 132 | for i, jdl in enumerate(jdls): |
134 | | - original_jdl = jdl.read() |
135 | | - |
136 | 133 | # Fix possible lack of brackets |
137 | | - if original_jdl.strip()[0] != "[": |
138 | | - original_jdl = f"[{original_jdl}]" |
| 134 | + if jdl.strip()[0] != "[": |
| 135 | + jdl = f"[{jdl}]" |
139 | 136 |
|
140 | | - class_ad_job = ClassAd(original_jdl) |
| 137 | + class_ad_job = ClassAd(jdl) |
141 | 138 | if class_ad_job.lookupAttribute("InputSandbox"): |
142 | 139 | isb = class_ad_job.getListFromExpression("InputSandbox") |
143 | 140 | sandboxes_pfn = await create_sandbox( |
144 | 141 | paths=[Path(file_path) for file_path in isb] |
145 | 142 | ) |
146 | | - print(f"InputSandbox created: {sandboxes_pfn[13:]}") |
| 143 | + logging.info(f"InputSandbox created: {sandboxes_pfn[13:]}") |
147 | 144 | class_ad_job.set_expression("InputSandbox", {sandboxes_pfn}) |
148 | 145 |
|
149 | 146 | jdls[i] = class_ad_job.asJDL() |
|
0 commit comments