(bugfix) follow-up for https://gerrit.wikimedia.org/r/#/c/112195/

Since the last committ we use Site.fromDBName() to get the the site
code instead extracting them directly. Site.fromDBName() creates a
site object and this may fail with NoSuchSite exception if the
dbname returned by wikidata is a obsolete site. Unfortunately
that may occur.

In this case we can no longer test against that exception outside
generator because the site object is already been created but we
must check it inside the generator. This is impossible for
generator expressions. We need a generator method instead.

Change-Id: I990b0d65909fe9f2adfec96a270b88bb62336360