On Tue, Jun 22, 2010 at 07:17:39PM +0200, Guido Trotter wrote:
> On Tue, Jun 22, 2010 at 6:55 PM, Iustin Pop <[email protected]> wrote:
> > On Tue, Jun 22, 2010 at 03:51:05PM +0200, Guido Trotter wrote:
> >> On Wed, Jun 16, 2010 at 5:21 AM, Iustin Pop <[email protected]> wrote:
> >> > The patch also modifies the internal methods in LUDiagnoseOS and gnt-os
> >> > to deal with the format change of call_os_diagnose.
> >>
> >> I don't see anywhere code that makes the verify (or validate as the
> >> design doc says) script mandatory on api 20, and not required below.
> >> Is it in a subsequent patch?
> >
> > It's actually in the previous patch. By the fact that we add 
> > OS_SCRIPT_VERIFY to the OS_SCRIPTS frozenset, it's caught by this check 
> > (existing):
> >  # OS Files dictionary, we will populate it with the absolute path names
> >  os_files = dict.fromkeys(constants.OS_SCRIPTS)
> >
> > in the _TryOSFromDisk.
> >
> 
> But that makes it mandatory also if the OS doesn't export api 20, doesn't it?

OK, I have an interdiff:

diff --git a/lib/backend.py b/lib/backend.py
index 1feb0da..c4455d8 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -1849,6 +1849,8 @@ def _TryOSFromDisk(name, base_dir=None):
 
   if max(api_versions) >= constants.OS_API_V20:
     os_files[constants.OS_PARAMETERS_FILE] = ''
+  else:
+    del os_files[constants.OS_SCRIPT_VERIFY]
 
   for filename in os_files:
     os_files[filename] = utils.PathJoin(os_dir, filename)


The reason for doing it this way is that constants.OS_SCRIPTS is only
used here, in this function, to mark all OS files that should be
executable. If we remove OS_SCRIPT_VERIFY, then we need to add another
frozenset for the really-executable-files, or split the constants into
executable files, and then per-API-version required files. That can be
done, but I'd propose to do that only when we implement the os_version
checks.

iustin

Reply via email to