Skip to content

Commit

Permalink
Fix exception class names
Browse files Browse the repository at this point in the history
  • Loading branch information
jrha committed Jul 16, 2024
1 parent 53fcf39 commit acffd22
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def mirror(self):
mirrorreposync(url, self.srcdir, '%s-%s' % (self.dist.nick, self.name), self.dist)
else:
error(2, 'Scheme %s:// not implemented yet (in %s)' % (s, url))
except mrepoMirrorException as instance:
except MrepoMirrorException as instance:
error(0, 'Mirroring failed for %s with message:\n %s' % (url, instance.value))
EXITCODE = 2
if not self.url:
Expand Down Expand Up @@ -584,14 +584,14 @@ def createmd(self):
if md in ('createrepo', 'repomd'):
self.repomd()

except mrepoGenerateException as instance:
except MrepoGenerateException as instance:
error(0, 'Generating repo failed for %s with message:\n %s' % (self.name, instance.value))
exitcode = 2

def repomd(self):
"Create a repomd repository"
if not cf.cmd['createrepo']:
raise mrepoGenerateException('Command createrepo is not found. Skipping.')
raise MrepoGenerateException('Command createrepo is not found. Skipping.')

groupfilename = 'comps.xml'

Expand Down Expand Up @@ -619,18 +619,18 @@ def repomd(self):
info(2, '%s: Create repomd repository for %s' % (self.dist.nick, self.name))
ret = run('%s %s %s' % (cf.cmd['createrepo'], repoopts, self.wwwdir))
if ret:
raise mrepoGenerateException('%s failed with return code: %s' % (cf.cmd['createrepo'], ret))
raise MrepoGenerateException('%s failed with return code: %s' % (cf.cmd['createrepo'], ret))


class mrepoMirrorException(Exception):
class MrepoMirrorException(Exception):
def __init__(self, value):
self.value = value

def __str__(self):
return repr(self.value)


class mrepoGenerateException(Exception):
class MrepoGenerateException(Exception):
def __init__(self, value):
self.value = value

Expand Down Expand Up @@ -894,7 +894,7 @@ def mirrorrsync(url, path):

ret = run('%s %s %s %s' % (cf.cmd['rsync'], opts, url, path), dryrun=True)
if ret:
raise mrepoMirrorException('Failed with return code: %s' % ret)
raise MrepoMirrorException('Failed with return code: %s' % ret)


def mirrorlftp(url, path, dist):
Expand Down Expand Up @@ -937,7 +937,7 @@ def mirrorlftp(url, path, dist):

ret = run('%s %s -c \'%s mirror %s %s %s\'' % (cf.cmd['lftp'], opts, cmds, mirroropts, url, path), dryrun=True)
if ret:
raise mrepoMirrorException('Failed with return code: %s' % ret)
raise MrepoMirrorException('Failed with return code: %s' % ret)


def mirrorreposync(url, path, reponame, dist):
Expand Down Expand Up @@ -997,7 +997,7 @@ def mirrorreposync(url, path, reponame, dist):
os.remove(reposync_conf_file)

if ret:
raise mrepoMirrorException('Failed with return code: %s' % ret)
raise MrepoMirrorException('Failed with return code: %s' % ret)


def which(cmd):
Expand Down

0 comments on commit acffd22

Please sign in to comment.