Skip to content

Commit

Permalink
style: format code with Black and PHP CS Fixer
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 4e45142 according to the output
from Black and PHP CS Fixer.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Sep 16, 2024
1 parent e8f1083 commit fdf961c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
4 changes: 3 additions & 1 deletion services/mmc/plugins/updates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def white_unlist_update(updateid):


def get_machine_with_update(kb, updateid, uuid, start=0, limit=-1, filter=""):
result = XmppMasterDatabase().get_machine_with_update(kb, updateid, uuid, start, limit, filter, Glpi().config)
result = XmppMasterDatabase().get_machine_with_update(
kb, updateid, uuid, start, limit, filter, Glpi().config
)
return result


Expand Down
35 changes: 23 additions & 12 deletions services/pulse2/database/xmppmaster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13242,7 +13242,9 @@ def get_conformity_update_by_machine(self, session, idmachine):
return result

@DatabaseHelper._sessionm
def get_machine_with_update(self, session, kb, updateid, uuid, start=0, limit=-1, filter="", config=None):
def get_machine_with_update(
self, session, kb, updateid, uuid, start=0, limit=-1, filter="", config=None
):

filter_on = ""
if config is not None and config.filter_on is not None:
Expand All @@ -13256,7 +13258,11 @@ def get_machine_with_update(self, session, kb, updateid, uuid, start=0, limit=-1
column = "lgf.states_id"
elif key == "type":
column = "lgf.computertypes_id"
filter_on = " %s AND %s in (%s) "%(filter_on, column, ",".join(config.filter_on[key]))
filter_on = " %s AND %s in (%s) " % (
filter_on,
column,
",".join(config.filter_on[key]),
)
try:
start = int(start)
except:
Expand All @@ -13272,7 +13278,10 @@ def get_machine_with_update(self, session, kb, updateid, uuid, start=0, limit=-1

sfilter = ""
if filter != "":
sfilter = """AND (lgm.name LIKE '%%%s%%' OR m.platform LIKE '%%%s%%')""" % tuple(filter for x in range(0, 2))
sfilter = (
"""AND (lgm.name LIKE '%%%s%%' OR m.platform LIKE '%%%s%%')"""
% tuple(filter for x in range(0, 2))
)

sql = """Select SQL_CALC_FOUND_ROWS
lgm.id,
Expand Down Expand Up @@ -13325,18 +13334,20 @@ def get_machine_with_update(self, session, kb, updateid, uuid, start=0, limit=-1
group by lgm.id
order by name
%s
"""%(updateid, uuid.replace("UUID", ""), filter_on, sfilter, kb, filter_on, sfilter, filterlimit)
""" % (
updateid,
uuid.replace("UUID", ""),
filter_on,
sfilter,
kb,
filter_on,
sfilter,
filterlimit,
)

datas = session.execute(sql)
count = session.execute("SELECT FOUND_ROWS();")
result = {
"total":0,
"datas" : {
"id":[],
"name":[],
"os":[]
}
}
result = {"total": 0, "datas": {"id": [], "name": [], "os": []}}
for elem in count:
result["total"] = elem[0]
break
Expand Down

0 comments on commit fdf961c

Please sign in to comment.