Skip to content

Commit

Permalink
Merge pull request dagwieers#23 from stfc/minor_fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
Oli-Rest authored Jul 18, 2024
2 parents 7872a6a + 4c93ad7 commit 8e0539e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 7 additions & 7 deletions mrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
_SUBST_SUB = re.compile(r'\$\{?(\w+)\}?').sub


class Options:
class Options(object):
def __init__(self, args):
self.configfile = '/etc/mrepo.conf'
self.dists = []
Expand Down Expand Up @@ -175,7 +175,7 @@ def help(self):
'''


class Config:
class Config(object):
def __init__(self):
self.read(OPTIONS.configfile)

Expand Down Expand Up @@ -274,7 +274,7 @@ def update(self):
continue
else:
### Check if section has appended arch
for arch in ARCHS.keys():
for arch in ARCHS:
if section.endswith('-%s' % arch):
archlist = (arch,)
distname = section.split('-%s' % arch)[0]
Expand Down Expand Up @@ -338,7 +338,7 @@ def getoption(self, section, option, var):
return var


class Dist:
class Dist(object):
def __init__(self, dist, arch, config):
self.arch = arch
self.dist = dist
Expand Down Expand Up @@ -452,7 +452,7 @@ def keyfunc(x):
repo.changed = True


class Repo:
class Repo(object):
def __init__(self, name, url, dist, config):
self.name = name
self.url = url
Expand Down Expand Up @@ -561,7 +561,7 @@ def lock(self, action):
lockfile = path_join(CONFIG.lockdir, self.dist.nick, action + '-' + self.name + '.lock')
mkdir(os.path.dirname(lockfile))
try:
file_object = os.open(lockfile, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0600)
file_object = os.open(lockfile, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o0600)
info(6, '%s: Setting lock %s' % (self.dist.nick, lockfile))
os.write(file_object, '%d' % os.getpid())
os.close(file_object)
Expand Down Expand Up @@ -1153,7 +1153,7 @@ def listrpmlinks(directory):

def main():
### Check availability of commands
for cmd in CONFIG.cmd.keys():
for cmd in CONFIG.cmd:
if not CONFIG.cmd[cmd]:
continue
cmdlist = CONFIG.cmd[cmd].split()
Expand Down
2 changes: 0 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/python2

import os
import sys

import os.path
from os.path import join as path_join

Expand Down

0 comments on commit 8e0539e

Please sign in to comment.