Skip to content

Commit

Permalink
Closes-Bug: #1545817 - Removing puppet manifests when package is deleted
Browse files Browse the repository at this point in the history
The puppet manifests stored in /etc/puppet/environments dir will also be deleted whenever a package is deleted from SM

Change-Id: I0d6647797af890eda703959fea984d52448b5998
  • Loading branch information
nitishkrishna committed Feb 15, 2016
1 parent febc251 commit c1ece61
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/server_mgr_main.py
Expand Up @@ -2479,6 +2479,19 @@ def delete_image(self):
shutil.rmtree(
self._args.html_root_dir + "contrail/repo/" +
image_id, True)
# remove puppet modules
# new contrail packages manifests dir
puppet_manifest_dir = "/etc/puppet/environments/" + image_id.replace('-', '_')
if os.path.isdir(puppet_manifest_dir):
shutil.rmtree(
puppet_manifest_dir, True
)
# old contrail packages manifests dir
puppet_manifest_old_dir = "/etc/puppet/environments/contrail_" + image_id
if os.path.isdir(puppet_manifest_old_dir):
shutil.rmtree(
puppet_manifest_old_dir, True
)
# delete repo from cobbler
if self._smgr_cobbler:
self._smgr_cobbler.delete_repo(image_id)
Expand Down

0 comments on commit c1ece61

Please sign in to comment.