Skip to content

Commit

Permalink
Improve NodePublish logs
Browse files Browse the repository at this point in the history
Add some additional information on debug logs for the NodePublishVolume
operation.
  • Loading branch information
Akrog committed Apr 8, 2020
1 parent 26af757 commit 5cc0ad7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ember_csi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ def _vol_private_location(self, volume_id):
def _get_mount(self, private_bind):
mounts = self._get_split_file('/proc/self/mounts')
result = [mount for mount in mounts if mount[0] == private_bind]
if not result:
LOG.debug('Private bind %s not found in %s' % (private_bind,
mounts))
return result

def _get_device(self, path):
Expand All @@ -808,9 +811,11 @@ def _get_device(self, path):
The source of a mounted path will either be the mount source of the
mount point or the root if it's a bind mount.
"""
for mount in self._get_mountinfo():
mount_info = self._get_mountinfo()
for mount in mount_info:
if mount.mount_point == path:
return mount.source
LOG.debug('Could not find %s as dest in %s' % (path, mount_info))
return None

IS_RO_REGEX = re.compile(r'(^|.+,)ro($|,.+)')
Expand Down Expand Up @@ -1130,6 +1135,7 @@ def NodePublishVolume(self, request, context):
target, request, context)

if error or not conn:
LOG.debug('Failing because error=%s and conn=%s' % (error, conn))
context.abort(grpc.StatusCode.FAILED_PRECONDITION,
'Staging was not been successfully called')

Expand Down

0 comments on commit 5cc0ad7

Please sign in to comment.