Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the .strip() method to remove whitespace characters at both ends … #5968

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions avocado/utils/pci.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,16 +549,16 @@ def get_vpd(dom_pci_address):
if len(line) < 5:
continue
if "*YL" in line:
vpd_dic["slot"] = line[4:]
vpd_dic["slot"] = line[4:].strip()
elif "*DS" in line:
vpd_dic["pci_id"] = line[4:]
vpd_dic["pci_id"] = line[4:].strip()
elif "*FC" in line:
vpd_dic["feature_code"] = line[4:]
vpd_dic["feature_code"] = line[4:].strip()
elif "*AX" in line:
if not (dom_pci_address in line or vpd_dic["pci_id"].split()[0] in line):
dev_list.append(line[4:])
dev_list.append(line[4:].strip())
elif "*CD" in line:
vpd_dic["pci_id"] = line[4:]
vpd_dic["pci_id"] = line[4:].strip()
vpd_dic["devices"] = dev_list
return vpd_dic

Expand Down
4 changes: 2 additions & 2 deletions avocado/utils/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ def get_container_info(self, container_id):
)
except PodmanException as ex:
raise PodmanException(
f"Failed getting information about container:" f" {container_id}."
f"Failed getting information about container: {container_id}."
) from ex
containers = json.loads(stdout.decode())
for container in containers:
if container["Id"] == container_id:
if container.get["Id"] == container_id:
return container
return {}

Expand Down
Loading