Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content_view_version does not allow creating version numbers > 4 digits, even though katello accepts any valid integer #1087

Closed
nixfu opened this issue Dec 4, 2020 · 2 comments · Fixed by #1091

Comments

@nixfu
Copy link

nixfu commented Dec 4, 2020

SUMMARY

When publishing a new content view version, and you provide a version number you want it created as, it will not accept more than 4 digits.

I have used versions such as 20201201 in katello for quite a while via hammer and the API.

Something in the collection code is rejecting creating content views with anything more than 4 digit version numbers.

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION

ansible 2.9.14

KATELLO/FOREMAN VERSION

3.15

STEPS TO REPRODUCE

specify "version: 12345" when creating a new content_view_version

EXPECTED RESULTS

Katello/Foreman actually will except anything that is an integer for the major and minor numbers.

ACTUAL RESULTS
fatal: [localhost -> 127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 127.0.0.1 closed.\r
", "module_stdout": "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html\r
  InsecureRequestWarning)\r
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html\r
  InsecureRequestWarning)\r
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html\r
  InsecureRequestWarning)\r
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html\r
  InsecureRequestWarning)\r
Traceback (most recent call last):\r
  File \"/home/myusername/.ansible/tmp/ansible-tmp-1607103112.51-31237-205164981239553/AnsiballZ_content_view_version.py\", line 102, in <module>\r
    _ansiballz_main()\r
  File \"/home/myusername/.ansible/tmp/ansible-tmp-1607103112.51-31237-205164981239553/AnsiballZ_content_view_version.py\", line 94, in _ansiballz_main\r
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r
  File \"/home/myusername/.ansible/tmp/ansible-tmp-1607103112.51-31237-205164981239553/AnsiballZ_content_view_version.py\", line 40, in invoke_module\r
    runpy.run_module(mod_name='ansible_collections.theforeman.foreman.plugins.modules.content_view_version', init_globals=None, run_name='__main__', alter_sys=True)\r
  File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\r
    fname, loader, pkg_name)\r
  File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\r
    mod_name, mod_fname, mod_loader, pkg_name)\r
  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\r
    exec code in run_globals\r
  File \"/tmp/ansible_theforeman.foreman.content_view_version_payload_r83Wpo/ansible_theforeman.foreman.content_view_version_payload.zip/ansible_collections/theforeman/foreman/plugins/modules/content_view_version.py\", line 234, in <module>\r
  File \"/tmp/ansible_theforeman.foreman.content_view_version_payload_r83Wpo/ansible_theforeman.foreman.content_view_version_payload.zip/ansible_collections/theforeman/foreman/plugins/modules/content_view_version.py\", line 213, in main\r
IndexError: list index out of range\r
", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}
@nixfu nixfu changed the title content_view_versions does not allow version numbers > 4 digits content_view_version does not allow version numbers > 4 digits Dec 4, 2020
@nixfu nixfu changed the title content_view_version does not allow version numbers > 4 digits content_view_version does not allow creating version numbers > 4 digits, even though katello accepts any valid integer Dec 4, 2020
@evgeni
Copy link
Member

evgeni commented Dec 5, 2020

Can you try using adding ".0" to your version string? Like "20201201.0"?

@evgeni
Copy link
Member

evgeni commented Dec 8, 2020

So yea, I can only reproduce that when I omit the ".0" from the version string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants