Skip to content

Commit 4061026

Browse files
committed
chore: remove merge conflicts
1 parent 02c522f commit 4061026

File tree

5 files changed

+176
-793
lines changed

5 files changed

+176
-793
lines changed

podman/domain/containers_create.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def create(
247247
in case of read_only options set to True. Default: False
248248
remove (bool): Remove the container when it has finished running. Default: False.
249249
restart_policy (dict[str, Union[str, int]]): Restart the container when it exits.
250-
251250
Configured as a dictionary with keys:
252251
253252
- Name: One of on-failure, or always.
@@ -774,4 +773,4 @@ def parse_host_port(_container_port, _protocol, _host):
774773
"Unknown keyword argument(s): " + " ,".join(f"'{k}'" for k in args.keys())
775774
)
776775

777-
return params
776+
return params

podman/domain/images_manager.py

+1-41
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
import logging
77
import os
88
import urllib.parse
9-
<<<<<<< HEAD
109
from typing import Any, Literal, Optional, Union
11-
=======
12-
from typing import Any, Optional, Union
13-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
1410
from collections.abc import Iterator, Mapping, Generator
1511
from pathlib import Path
1612
import requests
@@ -53,11 +49,7 @@ def exists(self, key: str) -> bool:
5349
response = self.client.get(f"/images/{key}/exists")
5450
return response.ok
5551

56-
<<<<<<< HEAD
5752
def list(self, **kwargs) -> builtins.list[Image]:
58-
=======
59-
def list(self, **kwargs) -> list[Image]:
60-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
6153
"""Report on images.
6254
6355
Keyword Args:
@@ -211,13 +203,8 @@ def prune(
211203
response = self.client.post("/images/prune", params=params)
212204
response.raise_for_status()
213205

214-
<<<<<<< HEAD
215206
deleted: builtins.list[dict[str, str]] = []
216207
error: builtins.list[str] = []
217-
=======
218-
deleted: list[dict[str, str]] = []
219-
error: list[str] = []
220-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
221208
reclaimed: int = 0
222209
# If the prune doesn't remove images, the API returns "null"
223210
# and it's interpreted as None (NoneType)
@@ -315,11 +302,7 @@ def push(
315302

316303
@staticmethod
317304
def _push_helper(
318-
<<<<<<< HEAD
319305
decode: bool, body: builtins.list[dict[str, Any]]
320-
=======
321-
decode: bool, body: list[dict[str, Any]]
322-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
323306
) -> Iterator[Union[str, dict[str, Any]]]:
324307
"""Helper needed to allow push() to return either a generator or a str."""
325308
for entry in body:
@@ -335,11 +318,7 @@ def pull(
335318
tag: Optional[str] = None,
336319
all_tags: bool = False,
337320
**kwargs,
338-
<<<<<<< HEAD
339321
) -> Union[Image, builtins.list[Image], Iterator[str]]:
340-
=======
341-
) -> Union[Image, list[Image], Iterator[str]]:
342-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
343322
"""Request Podman service to pull image(s) from repository.
344323
345324
Args:
@@ -351,11 +330,8 @@ def pull(
351330
auth_config (Mapping[str, str]) – Override the credentials that are found in the
352331
config for this request. auth_config should contain the username and password
353332
keys to be valid.
354-
<<<<<<< HEAD
355333
compatMode (bool) – Return the same JSON payload as the Docker-compat endpoint.
356334
Default: True.
357-
=======
358-
>>>>>>> b8f28e2 (Implement "decode" parameter in pull())
359335
decode (bool) – Decode the JSON data from the server into dicts.
360336
Only applies with ``stream=True``
361337
platform (str) – Platform in the format os[/arch[/variant]]
@@ -444,11 +420,7 @@ def pull(
444420
for item in reversed(list(response.iter_lines())):
445421
obj = json.loads(item)
446422
if all_tags and "images" in obj:
447-
<<<<<<< HEAD
448423
images: builtins.list[Image] = []
449-
=======
450-
images: list[Image] = []
451-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
452424
for name in obj["images"]:
453425
images.append(self.get(name))
454426
return images
@@ -493,11 +465,7 @@ def remove(
493465
image: Union[Image, str],
494466
force: Optional[bool] = None,
495467
noprune: bool = False, # pylint: disable=unused-argument
496-
<<<<<<< HEAD
497468
) -> builtins.list[dict[Literal["Deleted", "Untagged", "Errors", "ExitCode"], Union[str, int]]]:
498-
=======
499-
) -> list[dict[Literal["Deleted", "Untagged", "Errors", "ExitCode"], Union[str, int]]]:
500-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
501469
"""Delete image from Podman service.
502470
503471
Args:
@@ -516,23 +484,15 @@ def remove(
516484
response.raise_for_status(not_found=ImageNotFound)
517485

518486
body = response.json()
519-
<<<<<<< HEAD
520487
results: builtins.list[dict[str, Union[int, str]]] = []
521-
=======
522-
results: list[dict[str, Union[int, str]]] = []
523-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
524488
for key in ("Deleted", "Untagged", "Errors"):
525489
if key in body:
526490
for element in body[key]:
527491
results.append({key: element})
528492
results.append({"ExitCode": body["ExitCode"]})
529493
return results
530494

531-
<<<<<<< HEAD
532495
def search(self, term: str, **kwargs) -> builtins.list[dict[str, Any]]:
533-
=======
534-
def search(self, term: str, **kwargs) -> list[dict[str, Any]]:
535-
>>>>>>> fa8eb3e (Fix Code based on ruff 0.3->0.8.1)
536496
"""Search Images on registries.
537497
538498
Args:
@@ -612,4 +572,4 @@ def _stream_helper(self, response, decode=False):
612572
else:
613573
# Response isn't chunked, meaning we probably
614574
# encountered an error immediately
615-
yield self._result(response, json=decode)
575+
yield self._result(response, json=decode)

podman/domain/json_stream.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ def stream_as_text(stream):
1414
instead of byte streams.
1515
"""
1616
for data in stream:
17+
_data = data
1718
if not isinstance(data, str):
18-
data = data.decode('utf-8', 'replace')
19-
yield data
19+
_data = data.decode('utf-8', 'replace')
20+
yield _data
2021

2122

2223
def json_splitter(buffer):
@@ -71,4 +72,4 @@ def split_buffer(stream, splitter=None, decoder=lambda a: a):
7172
try:
7273
yield decoder(buffered)
7374
except Exception as e:
74-
raise StreamParseError(e) from e
75+
raise StreamParseError(e) from e

podman/domain/pods_manager.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def prune(self, filters: Optional[dict[str, str]] = None) -> dict[str, Any]:
101101
response.raise_for_status()
102102

103103
deleted: builtins.list[str] = []
104-
105104
for item in response.json():
106105
if item["Err"] is not None:
107106
raise APIError(
@@ -133,7 +132,7 @@ def remove(self, pod_id: Union[Pod, str], force: Optional[bool] = None) -> None:
133132
response.raise_for_status()
134133

135134
def stats(
136-
self, **kwargs
135+
self, **kwargs
137136
) -> Union[builtins.list[dict[str, Any]], Iterator[builtins.list[dict[str, Any]]]]:
138137
"""Resource usage statistics for the containers in pods.
139138
@@ -166,4 +165,4 @@ def stats(
166165
if stream:
167166
return api.stream_helper(response, decode_to_json=decode)
168167

169-
return json.loads(response.content) if decode else response.content
168+
return json.loads(response.content) if decode else response.content

0 commit comments

Comments
 (0)