'repos_hosting_url' gets '/fake_yumX' appended - this is hardcoded
Today I discovered it's effectively not possible to change repos used in robottelo.properties. Whatever I specify, it gets '/fake_yumX' appended (for X in 0..4) which works for the default value we use in automation but makes specifying another repo impossible.
Today, I discovered that the default repo doesn't work and wanted to use another so I specified repos_hosting_url=https://fixtures.pulpproject.org/rpm-signed/, repo sync then failed because the repo was created with the url of https://fixtures.pulpproject.org/rpm-signed//fake_yum1.
Debugging:
Just checked with another repo - FAKE_1_YUM_REPO :
(Pdb) FAKE_1_YUM_REPO
'http://<hostname>:<port>/fake_yum1'
Looking for ur specific URL.
Debugging 2:
Even for CUSTOM_RPM_REPO its working fine for me which points to rpm-sigined:
(Pdb) CUSTOM_RPM_REPO
'https://fixtures.pulpproject.org/rpm-signed/
@lhellebr can you provide more specific context around when you encountered this error?
What was the specific traceback?
What modifications had you made to robottelo.properties, or the constants (if any)?
Is this tied to a PR where we can reference your branch, or does this occur on the master branch?
To make this clear, what happened is that I wanted to use some fake repo server that is different to the one used in automation (e.g. https://fixtures.pulpproject.org/rpm-signed/). There are multiple actual repositories on that server, but none of them is "/fake_yum1". However, robottelo has it hard-coded that the repos on the server are "/fake_repoX" and therefore, my tests started failing when I updated robottelo.properties with this new repo. Expected result: I think it should be possible to change repo by editing just robottelo.properties, not code.
Contents of my robottelo.properties: repos_hosting_url=http://https://fixtures.pulpproject.org/rpm-signed/
Upstream URL in the created repo: https://fixtures.pulpproject.org/rpm-signed//fake_yum1
Error when syncing the created repo, shown in WebUI:
"traceback"=>
"Traceback (most recent call last):\n" +
" File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 367, in trace_task\n" +
" R = retval = fun(*args, **kwargs)\n" +
" File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 686, in __call__\n" +
" return super(Task, self).__call__(*args, **kwargs)\n" +
" File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 108, in __call__\n" +
" return super(PulpTask, self).__call__(*args, **kwargs)\n" +
" File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 622, in __protected_call__\n" +
" return self.run(*args, **kwargs)\n" +
" File \"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py\", line 797, in sync\n" +
" sync_report = sync_repo(transfer_repo, conduit, call_config)\n" +
" File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 894, in wrap_f\n" +
" return f(*args, **kwargs)\n" +
" File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py\", line 84, in sync_repo\n" +
" report = self._current_sync.run()\n" +
" File \"/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py\", line 368, in run\n" +
" reason=self.repomd_not_found_reason)\n" +
"PulpCodedException: Error retrieving metadata: Not Found\n",
Robottelo error:
E robottelo.cli.base.CLIReturnCodeError: CLIReturnCodeError(return_code=70, stderr='Task 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, elapsed: 00:00:00\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:02\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:04\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:06\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:08\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f warning: 1.0/1, 100%, 0.1/s, elapsed: 00:00:11\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f warning: 1.0/1, 100%, 0.1/s, elapsed: 00:00:11\nError: RPM1004: Error retrieving metadata: Not Found\n', msg='Command "repository synchronize" finished with return_code 70\nstderr contains following message:\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, elapsed: 00:00:00\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:02\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:04\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:06\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f running: 0.0/1, 0%, 0.0/s, elapsed: 00:00:08\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f warning: 1.0/1, 100%, 0.1/s, elapsed: 00:00:11\nTask 92df9bfc-532a-42cc-9d8c-389159d65e1f warning: 1.0/1, 100%, 0.1/s, elapsed: 00:00:11\nError: RPM1004: Error retrieving metadata: Not Found\n'
If you're using one of the FAKE_X_YUM_REPO constants defined in robottelo/constants/repos.py, then yes, /fake_yumX is appended to the repos_hosting_url value that you specified in robottelo.properties:
FAKE_0_YUM_REPO = f'{REPOS_URL}/fake_yum0'
FAKE_1_YUM_REPO = f'{REPOS_URL}/fake_yum1'
FAKE_2_YUM_REPO = f'{REPOS_URL}/fake_yum2'
FAKE_3_YUM_REPO = f'{REPOS_URL}/fake_yum3'
FAKE_4_YUM_REPO = f'{REPOS_URL}/fake_yum4'
The solution is to define your own repo string constant in your test module, and use that.
MY_REPO = f'{settings.repos_hosting_url}/my_repo_path'