Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ggatward authored Oct 14, 2018
2 parents 7e6535a + 1de89ad commit e2448ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- sat_export did not handle new backend_identifier value generated by Sat 6.3


## [1.2.3] - 2018-03-12
### Changed
- Export package count now counts DRPM packages exported by Sat 6.3

### Fixed
- sat_export did not handle new backend_identifier value generated by Sat 6.3


## [1.2.2] - 2018-02-25
### Added
- Option to tag a published content view with a custom comment
Expand Down
11 changes: 9 additions & 2 deletions clean_content_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def get_cv(org_id, cleanup_list, keep):

return ver_list, ver_descr, ver_keep

def get_content_view_version(cvid):
cvv = helpers.get_json(
helpers.KATELLO_API + "content_view_versions/" + str(cvid))

return cvv

def get_content_view_info(cvid):
"""
Expand Down Expand Up @@ -135,8 +140,10 @@ def cleanup(ver_list, ver_descr, dry_run, runuser, ver_keep, cleanall, ignorefir
helpers.log_msg(msg, 'DEBUG')

for version in cvinfo['versions']:
# Find versions that are not in any environment
if not version['environment_ids']:
# Get composite content views for version
cvv = get_content_view_version(version['id'])
# Find versions that are not in any environment and not in any composite content view
if not version['environment_ids'] and not cvv['composite_content_view_ids']:
if not locked:
msg = "Orphan view version " + str(version['version']) + " found in '" +\
str(ver_descr[cvid]) + "'"
Expand Down
7 changes: 7 additions & 0 deletions sat_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def get_cv(org_id):
# Return the ID (should be '1') and the label (forms part of the export path name)
return cv_result['id'], cv_ver, cv_result['label']


# Promote a content view version
def export_cv(dov_ver, last_export, export_type):
"""
Expand Down Expand Up @@ -1143,6 +1144,12 @@ def main(args):
else:
backend_id = repo_result['label']

# Satellite 6.3 uses a new backend_identifier key in the API result
if 'backend_identifier' in repo_result:
backend_id = repo_result['backend_identifier']
else:
backend_id = repo_result['label']

if ok_to_export:
# Trigger export on the repo
numfiles = export_puppet(repo_result['id'], backend_id, repo_result['relative_path'], last_export, export_type, pforge)
Expand Down

0 comments on commit e2448ba

Please sign in to comment.