Red Hat Bugzilla – Bug 1309944
[RFE] Create/update composite content-view by content-view Names
Last modified: 2017-09-15 02:17:01 EDT
Katello::content_view names are unique to an organization, so we should be able to use find_by(name: ['name1', 'name2']).
Also, in order to add a content view to a composite view you must first publish an initial version of the content view. Right now, if finding components by ID, if you give hammer 4 IDs and only 3 are found, nothing happens. The same will be true of arrays that contain content_view names that are yet unpublished or do not exist.
Finding ContentViewVersion (CVV) objects by ContentView (CV) names may return multiple CVV objects. Should I make all CVVs a component of the parent CV, or should I add only the latest CVVs based on latest major.minor version number?
In order to get the latest CVV for a CV, this feature needs to be implemented as well: https://bugzilla.redhat.com/show_bug.cgi?id=1167688
Created redmine issue http://projects.theforeman.org/issues/14604 from this bug
CLI users can add a version to a composite with content view name, minor, and major options (e.g. `hammer content-view add-version --id 1 --component-content-view blah --component-major-version 1 --component-minor-version 2`)
Feedback on the PR states that this feature should not be implemented.
The parameters you mention should be there but they're not which means there is still a bug here. I would probably either fix as part of this bugzilla or open a new bugzilla.
By the way, sorry if there was any confusion in my PR feedback.
hammer content-view add-version --id 2 --content-view-version 1.0 --content-view-version-content-view-id 3
hammer content-view remove-version --id 2 --content-view-version 1.0 --content-view-version-content-view-id 3
Attempting to create a CCV on Satellite 6.3 snap 5:
# hammer content-view list
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
5 | testview | testview | | 2016/10/18 14:36:24 | 4, 2, 3
3 | foo | foo | | 2016/10/18 14:04:46 |
When trying to create a composite with names (tried various versions with quotes for names, equal sign, etc.):
# hammer content-view create --name testcomposite --component-ids foo,testview --composite --organization-id 1
Could not create the content view:
Couldn't find Katello::ContentViewVersion with 'id'=0
# hammer content-view create --name testcomposite --component-ids 5,3 --composite --organization-id 1
Content view created
Also, note that the change in functionality should be reflected in hammer help that currently reads:
--component-ids COMPONENT_IDS List of component content view version ids for composite views
Comma separated list of values.
We should mention that component names can be used as well, maybe even change the option name that is strongly suggestive of IDs.
Upstream bug component is Hammer - Content