Files
dj/integration-work/fix_gpu1_token_name.py

12 lines
846 B
Python

import pathlib,json,subprocess
root=pathlib.Path('/home/ps/huobao-gpu-selection')
d=json.loads(subprocess.check_output(['docker','inspect','canvas-h3-prompt-normalizer-healthy-20261026'],text=True))[0]
tokens=pathlib.Path(next(m['Source'] for m in d['Mounts'] if m['Destination']=='/run/h3-workers'))
source=tokens/'huobao-gpu1.token';target=tokens/'gpu1.token'
assert source.resolve().parent==tokens.resolve() and target.resolve().parent==tokens.resolve()
assert not target.exists()
source.rename(target) # Preserve the named-user ACL and private permissions.
assert target.stat().st_mode&0o007==0
p=root/'extra-providers.json';rows=json.loads(p.read_text());rows[0]['control_token_file']='/run/h3-workers/gpu1.token';p.write_text(json.dumps(rows))
print('GPU1 token path now follows the existing provider-ID rule; token protection unchanged')