diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py index 9c59eb7..bcddd98 100644 --- a/src/centpkg/__init__.py +++ b/src/centpkg/__init__.py @@ -16,10 +16,10 @@ -import pyrpkg import os import re +from pyrpkg import Commands, rpkgError from . import centos_cert from . import cli @@ -53,7 +53,7 @@ class Commands(pyrpkg.Commands): try: osver = re.search(r'\d.*$', self.branch_merge).group() except AttributeError: - raise pyrpkg.rpkgError('Could not find the base OS ver from branch name' + raise rpkgError('Could not find the base OS ver from branch name' ' %s' % self.branch_merge) self._distval = osver self._distval = self._distval.replace('.', '_') @@ -81,7 +81,7 @@ class Commands(pyrpkg.Commands): self._spec = os.path.join('SPECS', __f) return - raise pyrpkg.rpkgError('No spec file found.') + raise rpkgError('No spec file found.') def load_target(self): """ This sets the target attribute (used for mock and koji) """ @@ -130,7 +130,7 @@ class Commands(pyrpkg.Commands): '.{0}.metadata'.format(self.module_name)), 'r').readlines() except IOError, e: - raise pyrpkg.rpkgError('%s is not a valid repo: %s' % (self.path, e)) + raise rpkgError('%s is not a valid repo: %s' % (self.path, e)) # Default to putting the files where the module is if not outdir: outdir = self.path @@ -141,7 +141,7 @@ class Commands(pyrpkg.Commands): # future csum, file = archive.strip().split(None, 1) except ValueError: - raise pyrpkg.rpkgError('Malformed sources file.') + raise rpkgError('Malformed sources file.') # The default lookaside hash is stored in centpkg.conf, but there is # a mix of md5 and sha sums in the CentOS lookaside, here we divine @@ -182,7 +182,7 @@ class Commands(pyrpkg.Commands): command.append(url) self._run_command(command) if not self._verify_file(outfile, csum, self.lookasidehash): - raise pyrpkg.rpkgError('%s failed checksum' % file) + raise rpkgError('%s failed checksum' % file) return