From a1a2e22b97791d51fba51ac05acce183ba1a1376 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Jul 25 2015 00:41:59 +0000 Subject: grab the OS version from the distgitdir object --- diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py index ffe523f..e8a99bd 100644 --- a/src/centpkg/__init__.py +++ b/src/centpkg/__init__.py @@ -112,12 +112,11 @@ class Commands(Commands): ''' Populate rpmdefines based on branch data ''' - try: - osver = re.search(r'\d.*$', self.branch_merge).group() - except AttributeError: - raise rpkgError('Could not find the base OS ver from branch name' - ' %s' % self.branch_merge) - self._distval = osver + + if not self.distgitdir.centosversion: + raise rpkgError('Could not get the OS version from the branch:{0}'.format(self.branch_merge)) + + self._distval = self.distgitdir.centosversion self._distval = self._distval.replace('.', '_') self._disttag = 'el%s' % self._distval