-
Notifications
You must be signed in to change notification settings - Fork 3
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
Updates (Sourcery refactored) #529
Conversation
lines = [] | ||
for row in ret: | ||
lines.append(row.toDict()) | ||
|
||
return lines | ||
return [row.toDict() for row in ret] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function UpdatesDatabase.tests
refactored with the following changes:
- Convert for loop into list comprehension (
list-comprehension
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
|
||
result = session.execute(sql) | ||
session.commit() | ||
session.flush() | ||
resultat = [x for x in result] | ||
|
||
resultat = list(result) | ||
print(resultat) | ||
if len(resultat) == 0: | ||
return -1 | ||
else: | ||
return [x for x in result] | ||
return -1 if not resultat else list(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function UpdatesDatabase.test_xmppmaster
refactored with the following changes:
- Replace identity comprehension with call to collection constructor [×2] (
identity-comprehension
) - Replace if statement with if expression (
assign-if-exp
) - Simplify sequence length comparison (
simplify-len-comparison
)
black_list = { 'nb_element_total': 0, | ||
'id' : [], | ||
'updateid_or_kb' : [], | ||
'title': [], | ||
"severity" : []} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function UpdatesDatabase.get_black_list
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring
) - Move assignment closer to its usage within a block (
move-assign-in-block
) - Merge dictionary assignment with declaration (
merge-dict-assign
) - Replace if statement with if expression (
assign-if-exp
)
grey_list={ 'nb_element_total': 0, | ||
'updateid' : [], | ||
'title' : [], | ||
'kb' : [], | ||
'valided' : [], | ||
'severity': []} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function UpdatesDatabase.get_grey_list
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
) - Move assignment closer to its usage within a block (
move-assign-in-block
) - Merge dictionary assignment with declaration (
merge-dict-assign
) - Replace if statement with if expression (
assign-if-exp
)
white_list={ 'nb_element_total': 0, | ||
'updateid' : [], | ||
'title' : [], | ||
'kb' : [], | ||
"severity": []} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function UpdatesDatabase.get_white_list
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
) - Move assignment closer to its usage within a block (
move-assign-in-block
) - Merge dictionary assignment with declaration (
merge-dict-assign
) - Replace if statement with if expression (
assign-if-exp
)
else: | ||
re = [y for y in [x for x in result]] | ||
for arssyncthing in re: | ||
self.update_ars_status(arssyncthing[4], "pausing") | ||
re = list(list(result)) | ||
for arssyncthing in re: | ||
self.update_ars_status(arssyncthing[4], "pausing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.get_ars_for_pausing_syncthing
refactored with the following changes:
- Remove unnecessary else after guard condition (
remove-unnecessary-else
) - Replace identity comprehension with call to collection constructor [×2] (
identity-comprehension
)
resultat = [x for x in result] | ||
if not resultat: | ||
return -1 | ||
else: | ||
return resultat[0][0] | ||
resultat = list(result) | ||
return -1 if not resultat else resultat[0][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.search_partage_for_package
refactored with the following changes:
- Replace identity comprehension with call to collection constructor (
identity-comprehension
) - Replace if statement with if expression (
assign-if-exp
)
resultat = [x for x in result] | ||
if len(resultat) == 0: | ||
return -1 | ||
else: | ||
return resultat[0][0] | ||
resultat = list(result) | ||
return -1 if not resultat else resultat[0][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.search_ars_cluster_for_package
refactored with the following changes:
- Replace identity comprehension with call to collection constructor (
identity-comprehension
) - Replace if statement with if expression (
assign-if-exp
) - Simplify sequence length comparison (
simplify-len-comparison
)
resultat = [x for x in result] | ||
resultat = list(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.search_ars_master_cluster_
refactored with the following changes:
- Replace identity comprehension with call to collection constructor (
identity-comprehension
)
resultat = [x for x in result] | ||
if resultat: | ||
return True | ||
else: | ||
return False | ||
return bool(resultat := list(result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.ars_in_num_cluster
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Replace identity comprehension with call to collection constructor (
identity-comprehension
) - Simplify boolean if expression (
boolean-if-exp-identity
) - Replace if statement with if expression (
assign-if-exp
)
setvalues = "AND xmppmaster.syncthing_machine.progress in (%s)" % ",".join([str(x) for x in valuecount]) | ||
setvalues = f'AND xmppmaster.syncthing_machine.progress in ({",".join([str(x) for x in valuecount])})' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.stat_syncthing_distributon
refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
re = [x for x in result] | ||
re = list(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.stat_syncthing_transfert
refactored with the following changes:
- Replace identity comprehension with call to collection constructor (
identity-comprehension
)
return [x for x in result][0] | ||
return list(result)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getnumcluster_for_ars
refactored with the following changes:
- Replace identity comprehension with call to collection constructor (
identity-comprehension
)
return [y for y in [x for x in result]] | ||
return list(list(result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getCluster_deploy_syncthing
refactored with the following changes:
- Replace identity comprehension with call to collection constructor [×2] (
identity-comprehension
)
sql = sql +";" | ||
sql = f"{sql};" | ||
result = session.execute(sql) | ||
session.commit() | ||
session.flush() | ||
return [x for x in result] | ||
return list(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getMachine_deploy_Syncthing
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
) - Replace identity comprehension with call to collection constructor (
identity-comprehension
)
if query is not None: | ||
user_list = [user[0] for user in query] | ||
return user_list | ||
else: | ||
return [] | ||
return [user[0] for user in query] if query is not None else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.get_list_of_users_for_shared_qa
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
def __returntextisNone__(para, text = ""): | ||
if para == None: | ||
return text | ||
else: | ||
return para | ||
def __returntextisNone__(self, text = ""): | ||
return text if self is None else self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.__returntextisNone__
refactored with the following changes:
- The first argument to instance methods should be
self
(instance-method-first-arg-name
) - Replace if statement with if expression (
assign-if-exp
) - Use x is None rather than x == None (
none-compare
)
presence = session.query(Machines.id).\ | ||
filter( Machines.macaddress.like(macaddress+'%')).first() | ||
presence = ( | ||
session.query(Machines.id) | ||
.filter(Machines.macaddress.like(f'{macaddress}%')) | ||
.first() | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getIdMachineFromMacaddress
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
filter(Machines.macaddress.like(macaddress) ).first() | ||
filter(Machines.macaddress.like(macaddress) ).first() | ||
elif agenttype=="machine": | ||
machine = session.query(Machines).\ | ||
filter(and_(Machines.macaddress.like(macaddress), | ||
filter(and_(Machines.macaddress.like(macaddress), | ||
Machines.agenttype.like("machine")) ).first() | ||
elif agenttype=="relayserver": | ||
machine = session.query(Machines).\ | ||
filter(and_(Machines.macaddress.like(macaddress), | ||
filter(and_(Machines.macaddress.like(macaddress), | ||
Machines.agenttype.like("relayserver")) ).first() | ||
session.commit() | ||
session.flush() | ||
result = {} | ||
if machine: | ||
result = { "id" : machine.id, | ||
"jid" : machine.jid, | ||
"platform" : machine.platform, | ||
"archi" : machine.archi, | ||
"hostname" : machine.hostname, | ||
"uuid_inventorymachine" : machine.uuid_inventorymachine, | ||
"ip_xmpp" : machine.ip_xmpp, | ||
"ippublic" : machine.ippublic, | ||
"macaddress" : machine.macaddress, | ||
"subnetxmpp" : machine.subnetxmpp, | ||
"agenttype" : machine.agenttype, | ||
"classutil" : machine.classutil, | ||
"groupdeploy" : machine.groupdeploy, | ||
"urlguacamole" : machine.urlguacamole, | ||
"picklekeypublic" : machine.picklekeypublic, | ||
'ad_ou_user': machine.ad_ou_user, | ||
'ad_ou_machine': machine.ad_ou_machine, | ||
'kiosk_presence': machine.kiosk_presence, | ||
'lastuser': machine.lastuser, | ||
'keysyncthing' : machine.keysyncthing, | ||
'enabled' : machine.enabled, | ||
'uuid_serial_machine' : machine.uuid_serial_machine} | ||
return result | ||
return ( | ||
{ | ||
"id": machine.id, | ||
"jid": machine.jid, | ||
"platform": machine.platform, | ||
"archi": machine.archi, | ||
"hostname": machine.hostname, | ||
"uuid_inventorymachine": machine.uuid_inventorymachine, | ||
"ip_xmpp": machine.ip_xmpp, | ||
"ippublic": machine.ippublic, | ||
"macaddress": machine.macaddress, | ||
"subnetxmpp": machine.subnetxmpp, | ||
"agenttype": machine.agenttype, | ||
"classutil": machine.classutil, | ||
"groupdeploy": machine.groupdeploy, | ||
"urlguacamole": machine.urlguacamole, | ||
"picklekeypublic": machine.picklekeypublic, | ||
'ad_ou_user': machine.ad_ou_user, | ||
'ad_ou_machine': machine.ad_ou_machine, | ||
'kiosk_presence': machine.kiosk_presence, | ||
'lastuser': machine.lastuser, | ||
'keysyncthing': machine.keysyncthing, | ||
'enabled': machine.enabled, | ||
'uuid_serial_machine': machine.uuid_serial_machine, | ||
} | ||
if machine | ||
else {} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getMachinefrommacadress
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace if statement with if expression (
assign-if-exp
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
filter(Machines.uuid_serial_machine.like(uuid_serial_machine) ).first() | ||
filter(Machines.uuid_serial_machine.like(uuid_serial_machine) ).first() | ||
elif agenttype=="machine": | ||
machine = session.query(Machines).\ | ||
filter(and_(Machines.uuid_serial_machine.like(uuid_serial_machine), | ||
filter(and_(Machines.uuid_serial_machine.like(uuid_serial_machine), | ||
Machines.agenttype.like("machine")) ).first() | ||
elif agenttype=="relayserver": | ||
machine = session.query(Machines).\ | ||
filter(and_(Machines.uuid_serial_machine.like(uuid_serial_machine), | ||
filter(and_(Machines.uuid_serial_machine.like(uuid_serial_machine), | ||
Machines.agenttype.like("relayserver")) ).first() | ||
session.commit() | ||
session.flush() | ||
result = {} | ||
if machine: | ||
result = { "id" : machine.id, | ||
"jid" : machine.jid, | ||
"platform" : machine.platform, | ||
"archi" : machine.archi, | ||
"hostname" : machine.hostname, | ||
"uuid_inventorymachine" : machine.uuid_inventorymachine, | ||
"ip_xmpp" : machine.ip_xmpp, | ||
"ippublic" : machine.ippublic, | ||
"macaddress" : machine.macaddress, | ||
"subnetxmpp" : machine.subnetxmpp, | ||
"agenttype" : machine.agenttype, | ||
"classutil" : machine.classutil, | ||
"groupdeploy" : machine.groupdeploy, | ||
"urlguacamole" : machine.urlguacamole, | ||
"picklekeypublic" : machine.picklekeypublic, | ||
'ad_ou_user': machine.ad_ou_user, | ||
'ad_ou_machine': machine.ad_ou_machine, | ||
'kiosk_presence': machine.kiosk_presence, | ||
'lastuser': machine.lastuser, | ||
'keysyncthing' : machine.keysyncthing, | ||
'enabled' : machine.enabled, | ||
'uuid_serial_machine' : machine.uuid_serial_machine} | ||
return result | ||
return ( | ||
{ | ||
"id": machine.id, | ||
"jid": machine.jid, | ||
"platform": machine.platform, | ||
"archi": machine.archi, | ||
"hostname": machine.hostname, | ||
"uuid_inventorymachine": machine.uuid_inventorymachine, | ||
"ip_xmpp": machine.ip_xmpp, | ||
"ippublic": machine.ippublic, | ||
"macaddress": machine.macaddress, | ||
"subnetxmpp": machine.subnetxmpp, | ||
"agenttype": machine.agenttype, | ||
"classutil": machine.classutil, | ||
"groupdeploy": machine.groupdeploy, | ||
"urlguacamole": machine.urlguacamole, | ||
"picklekeypublic": machine.picklekeypublic, | ||
'ad_ou_user': machine.ad_ou_user, | ||
'ad_ou_machine': machine.ad_ou_machine, | ||
'kiosk_presence': machine.kiosk_presence, | ||
'lastuser': machine.lastuser, | ||
'keysyncthing': machine.keysyncthing, | ||
'enabled': machine.enabled, | ||
'uuid_serial_machine': machine.uuid_serial_machine, | ||
} | ||
if machine | ||
else {} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getMachinefromuuidsetup
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace if statement with if expression (
assign-if-exp
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
if ret[0] == 0 : | ||
return False | ||
return True | ||
return ret[0] != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.is_jiduser_organization_ad
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
) - Simplify boolean if expression (
boolean-if-exp-identity
) - Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast
)
if uuid.strip().lower().startswith("uuid"): | ||
return uuid[4:] | ||
else: | ||
return uuid | ||
return uuid[4:] if uuid.strip().lower().startswith("uuid") else uuid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.uuidtoid
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
if ret[0] == 0 : | ||
return False | ||
return True | ||
return ret[0] != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.is_id_inventory_organization_ad
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
) - Simplify boolean if expression (
boolean-if-exp-identity
) - Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast
)
if ret[0] == 0 : | ||
return False | ||
return True | ||
return ret[0] != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.is_id_inventory_jiduser_organization_ad
refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else
) - Replace if statement with if expression (
assign-if-exp
) - Simplify boolean if expression (
boolean-if-exp-identity
) - Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast
)
query = query.filter(Organization_ad.ouuser.like('%'+filt+'%')) | ||
query = query.filter(Organization_ad.ouuser.like(f'%{filt}%')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getAllOUuser
refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
logging.getLogger().error("We tried to stop the deploiement for the cmd %s. We did not find the uuid %s" % (cmdid , inventoryuuid)) | ||
logging.getLogger().error( | ||
f"We tried to stop the deploiement for the cmd {cmdid}. We did not find the uuid {inventoryuuid}" | ||
) | ||
return machine | ||
|
||
except MultipleResultsFound as e: | ||
logging.getLogger().error(str(e)) | ||
logging.getLogger().error("When stopping the deploiement we detected several machines for the cmd %s and uuid %s " % (cmdid , inventoryuuid)) | ||
logging.getLogger().error( | ||
f"When stopping the deploiement we detected several machines for the cmd {cmdid} and uuid {inventoryuuid} " | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.get_machine_stop_deploy
refactored with the following changes:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring
)
ret={} | ||
ret['len']= len(machine) | ||
ret = {'len': len(machine)} | ||
arraylist = [] | ||
for t in machine: | ||
obj={} | ||
obj['title'] = t.title | ||
obj['pathpackage'] = t.pathpackage | ||
obj['jid_relay'] = t.jid_relay | ||
obj['inventoryuuid'] = t.inventoryuuid | ||
obj['jidmachine'] = t.jidmachine | ||
obj['state'] = t.state | ||
obj['sessionid']=t.sessionid | ||
obj['start'] = t.start | ||
obj['startcmd'] = t.startcmd | ||
obj['endcmd'] = t.endcmd | ||
obj['host'] = t.host | ||
obj['user'] = t.user | ||
obj['login'] = str(t.login) | ||
obj['command'] = t.command | ||
obj['group_uuid'] = t.group_uuid | ||
obj['macadress'] = t.macadress | ||
obj['syncthing'] = t.syncthing | ||
obj = { | ||
'title': t.title, | ||
'pathpackage': t.pathpackage, | ||
'jid_relay': t.jid_relay, | ||
'inventoryuuid': t.inventoryuuid, | ||
'jidmachine': t.jidmachine, | ||
'state': t.state, | ||
'sessionid': t.sessionid, | ||
'start': t.start, | ||
'startcmd': t.startcmd, | ||
'endcmd': t.endcmd, | ||
'host': t.host, | ||
'user': t.user, | ||
'login': str(t.login), | ||
'command': t.command, | ||
'group_uuid': t.group_uuid, | ||
'macadress': t.macadress, | ||
'syncthing': t.syncthing, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.get_group_stop_deploy
refactored with the following changes:
- Merge dictionary assignment with declaration [×18] (
merge-dict-assign
)
start = int(start) | ||
limit = int(limit) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getdeployment_cmd_and_title
refactored with the following changes:
- Move assignments closer to their usage (
move-assign
)
|
||
start = int(start) | ||
limit = int(limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getdeployment
refactored with the following changes:
- Move assignments closer to their usage (
move-assign
)
filter(and_( Deploy.inventoryuuid == uuid, Deploy.command == command_id)) | ||
filter(and_( Deploy.inventoryuuid == uuid, Deploy.command == command_id)) | ||
#, Deploy.result .isnot(None) | ||
#print relayserver | ||
relayserver = relayserver.all() | ||
session.commit() | ||
session.flush() | ||
ret={} | ||
ret['len']= len(relayserver) | ||
ret = {'len': len(relayserver)} | ||
arraylist=[] | ||
for t in relayserver: | ||
obj={} | ||
obj['pathpackage']=t.pathpackage | ||
obj['jid_relay']=t.jid_relay | ||
obj['inventoryuuid']=t.inventoryuuid | ||
obj['jidmachine']=t.jidmachine | ||
obj['state']=t.state | ||
obj['sessionid']=t.sessionid | ||
obj['start']=t.start | ||
if t.result is None: | ||
obj['result']="" | ||
else: | ||
obj['result']=t.result | ||
obj['host']=t.host | ||
obj['user']=t.user | ||
obj['login']=str(t.login) | ||
obj['command']=t.command | ||
obj = { | ||
'pathpackage': t.pathpackage, | ||
'jid_relay': t.jid_relay, | ||
'inventoryuuid': t.inventoryuuid, | ||
'jidmachine': t.jidmachine, | ||
'state': t.state, | ||
'sessionid': t.sessionid, | ||
'start': t.start, | ||
'result': "" if t.result is None else t.result, | ||
'host': t.host, | ||
'user': t.user, | ||
'login': str(t.login), | ||
'command': t.command, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function XmppMasterDatabase.getdeployfromcommandid
refactored with the following changes:
- Merge dictionary assignment with declaration [×13] (
merge-dict-assign
) - Replace if statement with if expression (
assign-if-exp
)
Pull Request #528 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
updates
branch, then run:Help us improve this pull request!