Skip to content

Commit

Permalink
multiple typos on loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
elg committed Sep 10, 2019
1 parent c0a9dc5 commit 0b51439
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions passhportd/app/models_mod/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ def changepass(self, date):
db.session.commit()
return "Password changed"
except exc.SQLAlchemyError as e:
app.loggererror('ERROR: -> ' + e.message)
app.loggererror("Error changing password on " + self.show_name())
app.logger.error('ERROR: -> ' + e.message)
app.logger.error("Error changing password on " + self.show_name())
return "Password unchanged"


4 changes: 2 additions & 2 deletions passhportd/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def checkandterminatesshsession():
except Exception as E:
if type(E) == psutil.NoSuchProcess:
endsshsession(entry.pid)
app.loggerwarning("Orphan connection with PID:" + \
app.logger.warning("Orphan connection with PID:" + \
str(entry.pid) + ". Now closed in the logentry.")

return "Active connections: check done."
Expand Down Expand Up @@ -262,7 +262,7 @@ def sshdisconnection(pid):

except Exception as E:
if type(E) == psutil.NoSuchProcess:
app.loggerwarning("Impossible to kill: no such process with PID " + str(pid))
app.logger.warning("Impossible to kill: no such process with PID " + str(pid))

return "Done"

Expand Down
6 changes: 3 additions & 3 deletions passhportd/app/views_mod/target/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def target_port(name):

# If there is no port declared, we assume it's 22
if port is None:
app.loggerwarning("No port set on " + name + ", 22 is used")
app.logger.warning("No port set on " + name + ", 22 is used")
port = "22"
else:
port = str(port).replace(" ","")
Expand All @@ -172,7 +172,7 @@ def target_login(name):

# If there is no user declared, we assume it's root
if login is None:
app.loggerwarning("No login set on " + name + ", root is used")
app.logger.warning("No login set on " + name + ", root is used")
login = "root"
else:
login = str(login).replace(" ","")
Expand Down Expand Up @@ -631,7 +631,7 @@ def extgetaccess(ip, targetname, username):
try:
db.session.commit()
except exc.SQLAlchemyError as e:
app.loggererror('ERROR registering connection demand: exttargetaccess "' + \
app.logger.error('ERROR registering connection demand: exttargetaccess "' + \
str(output) + '" -> ' + str(e))

# Create the output to print
Expand Down
4 changes: 2 additions & 2 deletions passhportd/app/views_mod/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def user_login():
# Check data validity uppon LDAP/local/whatever...
result = try_login(login, password)
if result == "success":
app.loggerinfo("Authentication ok for {}".format(login))
app.logger.info("Authentication ok for {}".format(login))
# If the LDAP connection is ok, user can connect
return utils.response("Authorized", 200)
else:
app.loggerwarning("Authentication error for {} => ".format(login) + str(result))
app.logger.warning("Authentication error for {} => ".format(login) + str(result))
return utils.response("Refused: " + str(result), 200)


Expand Down

0 comments on commit 0b51439

Please sign in to comment.