diff --git a/avocado/core/settings.py b/avocado/core/settings.py index 6de72463225beaf157bd4d6b79ea10994f5956a7..ddbf53dd99e039e8b474161e1a42970ef2737ca8 100644 --- a/avocado/core/settings.py +++ b/avocado/core/settings.py @@ -198,10 +198,16 @@ class Settings(object): for extra_file in glob.glob(os.path.join(_config_dir_system_extra, '*.conf')): self.process_config_path(extra_file) if not config_local: - path.init_dir(_config_dir_local) - with open(config_path_local, 'w') as config_local_fileobj: - config_local_fileobj.write('# You can use this file to override configuration values from ' - '%s and %s\n' % (config_path_system, _config_dir_system_extra)) + try: + path.init_dir(_config_dir_local) + with open(config_path_local, 'w') as config_local_fileobj: + content = ("# You can use this file to override " + "configuration values from '%s and %s\n" + % (config_path_system, + _config_dir_system_extra)) + config_local_fileobj.write(content) + except IOError: # Some users can't write it (docker) + pass else: self.process_config_path(config_path_local) else: