v7.3.1.0: Return insert result in db module

Modified the cred module in the db modules package. The insert statement under the try block was updated to return the result of the .execute() method. This will allow for better handling and control of the execution flow depending on the result of the insert operation.
pull/390/head
Aidaho 2024-06-17 07:46:01 +03:00
parent 70765749b9
commit 64d0475df6
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ def insert_new_ssh(name, enable, group, username, password):
if password is None:
password = 'None'
try:
Cred.insert(name=name, enable=enable, groups=group, username=username, password=password).execute()
return Cred.insert(name=name, enable=enable, groups=group, username=username, password=password).execute()
except Exception as e:
out_error(e)