Revision 8fa42c7c lib/backend.py
b/lib/backend.py | ||
---|---|---|
995 | 995 |
def DiagnoseOS(top_dirs=None): |
996 | 996 |
"""Compute the validity for all OSes. |
997 | 997 |
|
998 |
For each name in all the given top directories (if not given defaults |
|
999 |
to constants.OS_SEARCH_PATH) it will return an object. If this is a valid |
|
1000 |
os, the object will be an instance of the object.OS class. If not, |
|
1001 |
it will be an instance of errors.InvalidOS and this signifies that |
|
1002 |
this name does not correspond to a valid OS. |
|
998 |
Returns an OS object for each name in all the given top directories |
|
999 |
(if not given defaults to constants.OS_SEARCH_PATH) |
|
1003 | 1000 |
|
1004 | 1001 |
Returns: |
1005 |
list of objects |
|
1002 |
list of OS objects
|
|
1006 | 1003 |
|
1007 | 1004 |
""" |
1008 | 1005 |
if top_dirs is None: |
... | ... | |
1021 | 1018 |
os_inst = OSFromDisk(name, base_dir=dir) |
1022 | 1019 |
result.append(os_inst) |
1023 | 1020 |
except errors.InvalidOS, err: |
1024 |
result.append(err)
|
|
1021 |
result.append(objects.OS.FromInvalidOS(err))
|
|
1025 | 1022 |
|
1026 | 1023 |
return result |
1027 | 1024 |
|
... | ... | |
1075 | 1072 |
script) |
1076 | 1073 |
|
1077 | 1074 |
|
1078 |
return objects.OS(name=name, path=os_dir, |
|
1075 |
return objects.OS(name=name, path=os_dir, status=constants.OS_VALID_STATUS,
|
|
1079 | 1076 |
create_script=os_scripts['create'], |
1080 | 1077 |
export_script=os_scripts['export'], |
1081 | 1078 |
import_script=os_scripts['import'], |
Also available in: Unified diff