Merge "Temporary fix for lost upstart directory"

This commit is contained in:
Jenkins 2015-09-18 14:39:19 +00:00 committed by Gerrit Code Review
commit bfaf7fb856
2 changed files with 15 additions and 1 deletions

View File

@ -471,6 +471,20 @@ class Manager(object):
with open(os.path.join(chroot, 'etc/nailgun-agent/nodiscover'), 'w'):
pass
# FIXME(kozhukalov): When we have just os-root fs image and don't have
# os-var-log fs image while / and /var/log are supposed to be
# separate file systems and os-var-log is mounted into
# non-empty directory on the / file system, those files in /var/log
# directory become unavailable.
# The thing is that among those file there is /var/log/upstart
# where upstart daemon writes its logs. We have specific upstart job
# which is to flush open files once all file systems are mounted.
# This job needs upstart directory to be available on os-var-log
# file system.
# This is just a temporary fix and correct fix will be available soon
# via updates.
utils.execute('mkdir', '-p', chroot + '/var/log/upstart')
with open(chroot + '/etc/fstab', 'wb') as f:
for fs in self.driver.partition_scheme.fss:
# TODO(kozhukalov): Think of improving the logic so as to

View File

@ -119,7 +119,7 @@ class TestManager(unittest2.TestCase):
mock_utils, mock_gu, mock_open,
mock_grub):
def _fake_uuid(*args, **kwargs):
if args[5] == '/dev/mapper/os-root':
if len(args) >= 6 and args[5] == '/dev/mapper/os-root':
return ('FAKE_ROOTFS_UUID', None)
else:
return ('FAKE_UUID', None)