Skip to content

Commit

Permalink
Adding missing errno import. Corrected log calls in addTocEntry expli…
Browse files Browse the repository at this point in the history
…citly cast e.strerror as str to avoid None concat error
  • Loading branch information
swingingsimian committed Jun 21, 2017
1 parent 03ac32c commit fabf113
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/tocUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os.path as op
import re
from tornado.web import HTTPError
import errno
import logging

import h5py
Expand Down Expand Up @@ -103,7 +104,7 @@ def addTocEntry(domain, filePath, userid=None):
if userid is not None:
acl = db.getAcl(group_uuid, userid)
if not acl['create']:
self.log.info("unauthorized access to group:" + group_uuid)
log.info("unauthorized access to group:" + group_uuid)
raise IOError(errno.EACCES) # unauthorized
log.info("createExternalLink -- uuid %s, domain: %s, linkName: %s", group_uuid, domain, linkName)
db.createExternalLink(group_uuid, domain, '/', linkName)
Expand All @@ -113,7 +114,7 @@ def addTocEntry(domain, filePath, userid=None):
if userid is not None:
acl = db.getAcl(group_uuid, userid)
if not acl['create']:
self.log.info("unauthorized access to group:" + group_uuid)
log.info("unauthorized access to group:" + group_uuid)
raise IOError(errno.EACCES) # unauthorized
# create subgroup and link to parent group
subgroup_uuid = db.createGroup()
Expand All @@ -123,7 +124,7 @@ def addTocEntry(domain, filePath, userid=None):
group_uuid = subgroup_uuid

except IOError as e:
log.info("IOError: " + str(e.errno) + " " + e.strerror)
log.info("IOError: " + str(e.errno) + " " + str(e.strerror))
raise e

"""
Expand Down

0 comments on commit fabf113

Please sign in to comment.