Skip to content

Commit

Permalink
Fix update to work when CCV component uses latest
Browse files Browse the repository at this point in the history
  • Loading branch information
arusso committed Apr 25, 2019
1 parent c1e1d87 commit 1f7deb6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cvmanager
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,12 @@ def update()
puts_verbose " Found #{desired_version} as the 'latest' version"
end

# if the version of the component does not match the one the user requested update it
if component['version'].to_s != desired_version.to_s
puts " Updating from #{component['version']} to #{desired_version}"
# if the component version in the most recently published composite version does not match the one the user requested update it
ccv_latest_version = ccv['versions'].select { |obj| obj['version'] == ccv['latest_version'] }.first
component_cvv = @api.resource(:content_view_versions).call(:index, {:composite_version_id => ccv_latest_version['id'], :organization_id => @options[:org], :content_view_id => component['content_view']['id'] })
component_cvv_version = component_cvv['results'].first['version']
if component_cvv_version != desired_version.to_s
puts " Updating from #{component_cvv_version} to #{desired_version}"
oldids = ids.dup
ids.delete(component['id'])
cvversions = @api.resource(:content_view_versions).call(:index, {:content_view_id => component['content_view']['id'], :version => desired_version})
Expand Down

0 comments on commit 1f7deb6

Please sign in to comment.