diff --git a/lib/backend.py b/lib/backend.py index d263d1373cc8605b3a768d62b42197c05f22c65b..d3a4a54e1f2e0404b93d36a8737c391b8e96e8a7 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -1706,14 +1706,16 @@ def _TryOSFromDisk(name, base_dir=None): return False, ("File '%s' under path '%s' is missing (%s)" % (name, os_dir, _ErrnoOrStr(err))) - if stat.S_IMODE(st.st_mode) & stat.S_IXUSR != stat.S_IXUSR: - return False, ("File '%s' under path '%s' is not executable" % - (name, os_dir)) - if not stat.S_ISREG(stat.S_IFMT(st.st_mode)): return False, ("File '%s' under path '%s' is not a regular file" % (name, os_dir)) + if name in constants.OS_SCRIPTS: + if stat.S_IMODE(st.st_mode) & stat.S_IXUSR != stat.S_IXUSR: + return False, ("File '%s' under path '%s' is not executable" % + (name, os_dir)) + + os_obj = objects.OS(name=name, path=os_dir, create_script=os_files[constants.OS_SCRIPT_CREATE], export_script=os_files[constants.OS_SCRIPT_EXPORT],