Skip to content

Commit

Permalink
Merge pull request #557 from simondeziel/needrestart
Browse files Browse the repository at this point in the history
integration: avoid needrestart from prompting
  • Loading branch information
tomponline authored Aug 9, 2023
2 parents 6545b57 + 21ebbb1 commit fb501c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
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

0 comments on commit fb501c0

Please sign in to comment.