Skip to content

Commit

Permalink
Merge pull request #63 from huangpeng5/suyan_420
Browse files Browse the repository at this point in the history
don't raise error when dtree not exist on array with delete level_two path
  • Loading branch information
huangpeng5 authored Apr 22, 2024
2 parents ade265f + f1be74a commit 1b9d471
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ def _get_namespace_name_from_location(self, export_location):
self.namespace_name = export_location.split('\\')[-1].split('/')[-1]

def _get_dtree_quota_info(self, action, parent_id, new_size, parent_type):
if not parent_id:
error_msg = (_("%s share failed because of dtree not exist") % action)
LOG.error(error_msg)
raise exception.InvalidInput(reason=error_msg)

dtree_quota = self.helper.query_quota_by_parent(parent_id, parent_type)
cur_size = float(dtree_quota.get('space_used', 0.0)) / constants.CAPACITY_UNIT_BYTE_TO_GB
cur_size = math.ceil(cur_size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,9 @@ def query_dtree_by_name(self, dtree_name, namespace_id):
data = jsonutils.dumps(query_para)
result = self.call(url, data, "GET")

if result.get('result', {}).get('code') == 0 and result.get('data'):
if result.get('result', {}).get('code') == 0:
LOG.info(_("Query dtree success.(dtree_name: {0})".format(dtree_name)))
elif result.get('result', {}).get('code') == constants.DTREE_NOT_EXIST and not result.get('data'):
elif result.get('result', {}).get('code') == constants.DTREE_NOT_EXIST or not result.get('data'):
LOG.info(_("Query dtree does not exist.(dtree_name: {0})".format(dtree_name)))
else:
err_msg = _("Query dtree_name({0}) failed".format(dtree_name))
Expand Down

0 comments on commit 1b9d471

Please sign in to comment.