Skip to content

Commit

Permalink
Purge no longer needed Python < 2.5 workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Sep 30, 2016
1 parent 578df27 commit f0e154b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 0 additions & 2 deletions py/mock.py
Expand Up @@ -849,8 +849,6 @@ def run_command(options, args, config_opts, commands, buildroot, state):
state.alldone()

if __name__ == '__main__':
# fix for python 2.4 logging module bug:
logging.raiseExceptions = 0

exitStatus = 0

Expand Down
21 changes: 9 additions & 12 deletions py/mockbuild/buildroot.py
Expand Up @@ -11,6 +11,7 @@
import shutil
import stat
import tempfile
import uuid

from . import util
from . import mounts
Expand Down Expand Up @@ -209,18 +210,14 @@ def _setup_resolver_config(self):

@traceLog()
def _setup_dbus_uuid(self):
try:
import uuid
machine_uuid = uuid.uuid4().hex
dbus_uuid_path = self.make_chroot_path('etc', 'machine-id')
symlink_path = self.make_chroot_path('var', 'lib', 'dbus', 'machine-id')
with open(dbus_uuid_path, 'w') as uuid_file:
uuid_file.write(machine_uuid)
uuid_file.write('\n')
if not os.path.exists(symlink_path):
os.symlink("../../../etc/machine-id", symlink_path)
except ImportError:
pass
machine_uuid = uuid.uuid4().hex
dbus_uuid_path = self.make_chroot_path('etc', 'machine-id')
symlink_path = self.make_chroot_path('var', 'lib', 'dbus', 'machine-id')
with open(dbus_uuid_path, 'w') as uuid_file:
uuid_file.write(machine_uuid)
uuid_file.write('\n')
if not os.path.exists(symlink_path):
os.symlink("../../../etc/machine-id", symlink_path)

@traceLog()
def _setup_timezone(self):
Expand Down

0 comments on commit f0e154b

Please sign in to comment.