Add generic code to check repoclosure

Change-Id: I762abf97c9020301a388f7d83c7d1e41bdf1f062
Signed-off-by: Kiril Nesenko <knesenko@redhat.com>