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

integration: avoid needrestart from prompting #557

Merged
merged 4 commits into from
Aug 9, 2023
Merged
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
2 changes: 1 addition & 1 deletion integration/run-integration-tests
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -ex

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
busybox-static \
libffi-dev \
Expand Down
3 changes: 1 addition & 2 deletions pylxd/deprecated/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ def get_container_config(self, container):
def get_container_websocket(self, container):
return self.connection.get_status(
"GET",
"/1.0/operations/%s/websocket?secret=%s"
% (container["operation"], container["fs"]),
f"/1.0/operations/{container['operation']}/websocket?secret={container['fs']}",
)

def container_info(self, container):
Expand Down
4 changes: 2 additions & 2 deletions pylxd/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def __new__(cls, name, bases, attrs):
attributes.update(base.__attributes__)

for key, val in attrs.items():
if type(val) == Attribute:
if isinstance(val, Attribute):
attributes[key] = val
for_removal.append(key)
if type(val) in (Manager, Parent):
if isinstance(val, Manager) or isinstance(val, Parent):
managers.append(key)
for_removal.append(key)
for key in for_removal:
Expand Down
4 changes: 2 additions & 2 deletions pylxd/models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def all(cls, client, recursion=0):

instances = []
for instance in response.json()["metadata"]:
if type(instance) == dict:
if isinstance(instance, dict):
# User specified recursion so returning all data for each instance at once
instance_class = cls(client, name=instance["name"])
for key, data in instance.items():
Expand Down Expand Up @@ -793,7 +793,7 @@ def __init__(self, url, payload=None, **kwargs):
super().__init__(url, **kwargs)

def _smart_encode(self, msg):
if type(msg) == str and self.encoding:
if isinstance(msg, str) and self.encoding:
return msg.encode(self.encoding)
return msg

Expand Down
Loading