#10 fedfind raises error "Release must be a number or Rawhide!"
Closed Opened by sayanchowdhury.

fedfind==3.6.2 has been raising the error for the newer compose ids.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/moksha/hub/api/consumer.py", line 206, in _do_work
    self.consume(message)
  File "/usr/lib/python2.7/site-packages/fedimg/consumers.py", line 71, in consume
    cmetadata = fedfind.release.get_release_cid(compose_id).metadata
  File "/usr/lib/python2.7/site-packages/fedfind/release.py", line 64, in get_release_cid
    return get_release(cid=cid)
  File "/usr/lib/python2.7/site-packages/fedfind/release.py", line 450, in get_release
    release = guess_release(release, milestone, compose)
  File "/usr/lib/python2.7/site-packages/fedfind/release.py", line 220, in guess_release
    raise ValueError("get_release(): Release must be a number "
ValueError: get_release(): Release must be a number or Rawhide!

@sayanchowdhury It's probably useful to give info as to what compose IDs you are getting these errors for.

Here are a few of them:

Fedora-Epel-7-updates-20171025.0
Fedora-25-updates-testing-20171026.1
Fedora-26-updates-testing-20171027.0
Fedora-Modular-Bikeshed-20171024.n.0

I really am getting sick and tired of releng inventing five new freaking compose types every week...

So, fedfind 3.7.0 basically addresses this. It should handle Fedora-Modular-Bikeshed (which is just a new name for Rawhide nightly modular composes, for some reason releng decided to call them Bikeshed instead of Rawhide, I have no idea why they thought this was a good idea) correctly, there's a new Release class for that.

It should parse the compose IDs for updates and updates-testing composes correctly, but I intentionally did not add support for these composes, as they will never contain any images and fedfind is a very image-centric tool. So you will still get an exception from these composes, it will just be one that makes more sense.

Your code should handle get_release throwing exceptions anyway, it does so in various cases; usually the thing to do is just wrap it in a try / except ValueError as err block, and if you catch a ValueError, just log an error or warning with the contents of err, which should tell you approximately what went wrong.

3.7.1 is out as an update now. Please advise if you have any problems.

Metadata Update from @adamwill:
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/quality/fedfind/issues/10

Please continue any further discussion there.

Metadata