cli: objects: unbreak ogcli with python 3.8

Older versions of Python can't handle interleaved quote types.
Use single quotes as external string delimiter and double quotes
in every part of the strings when quotation is needed.
master 0.3.3-7
Alejandro Sirgo Rica 2024-06-03 21:33:53 +02:00
parent 29ab6cc0ed
commit 1fadb06b7e
2 changed files with 3 additions and 3 deletions

View File

@ -108,7 +108,7 @@ class OgDisk():
p = p[0] p = p[0]
if len(p) != 4: if len(p) != 4:
print(f'Invalid partition: requires "num,part_scheme,fs,size", "{','.join(p)}" provided') print(f'Invalid partition: requires "num,part_scheme,fs,size", "{",".join(p)}" provided')
return return
part_num, code, fs, size = p[0], p[1].upper(), p[2].upper(), p[3] part_num, code, fs, size = p[0], p[1].upper(), p[2].upper(), p[3]

View File

@ -13,7 +13,7 @@ import json
def _find_client_path(json_data, client_ip, res): def _find_client_path(json_data, client_ip, res):
if json_data['type'] == 'computer': if json_data['type'] == 'computer':
if json_data['ip'] == client_ip: if json_data['ip'] == client_ip:
res.append(f'{json_data['type']}: {client_ip}') res.append(f'{json_data["type"]}: {client_ip}')
return True return True
return False return False
@ -21,7 +21,7 @@ def _find_client_path(json_data, client_ip, res):
for child in children: for child in children:
found = _find_client_path(child, client_ip, res) found = _find_client_path(child, client_ip, res)
if found: if found:
res.append(f'{json_data['type']}: {json_data['name']}') res.append(f'{json_data["type"]}: {json_data["name"]}')
return True return True
return False return False