Skip to content

Commit

Permalink
Delete serialized files when ring is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanBoronat committed Nov 17, 2017
1 parent ef5458d commit 08fa97a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/swift_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,19 @@ def storage_policy_detail(request, storage_policy_id):
policy_file_path_dep = get_policy_file_path(settings.SWIFT_CFG_DEPLOY_DIR, storage_policy_id)
if os.path.isfile(policy_file_path_dep):
os.remove(policy_file_path_dep)

gzip_policy_file_dep = policy_file_path_dep.replace('builder', 'ring.gz')
if os.path.isfile(gzip_policy_file_dep):
os.remove(gzip_policy_file_dep)

policy_file_path_tmp = get_policy_file_path(settings.SWIFT_CFG_TMP_DIR, storage_policy_id)
if os.path.isfile(policy_file_path_tmp):
os.remove(policy_file_path_tmp)

gzip_policy_file_tmp = policy_file_path_tmp.replace('builder', 'ring.gz')
if os.path.isfile(gzip_policy_file_tmp):
os.remove(gzip_policy_file_tmp)

deploy_swift_file = get_swift_cfg_path(settings.SWIFT_CFG_DEPLOY_DIR)

config_parser = ConfigParser.RawConfigParser()
Expand Down

0 comments on commit 08fa97a

Please sign in to comment.