def __init__(self): scol = PkName('script') tcol = Name('type') tcol.set_fk('scriptnames') fcol = Text('scriptfile') columns = [scol, tcol] + suiteversion_cols() + [fcol] Table.__init__(self, 'scripts', columns)
def __init__(self, fs_table, disks_table): fs_col = PkName('filesystem') fs_col.set_fk(fs_table) diskname_col = PkName('diskname') diskname_col.set_fk(disks_table) columns = [fs_col, diskname_col] Table.__init__(self, 'filesystem_disks', columns)
def __init__(self, name, mach_types_table, disks_table): mtype_col = PkName('machine_type') mtype_col.set_fk(mach_types_table) diskname_col = PkName('diskname') diskname_col.set_fk(disks_table) columns = [mtype_col, diskname_col, PkName('device')] Table.__init__(self, name, columns)
def __init__(self, profiles_table, traits_table): profile_col = PkName('profile') profile_col.set_fk(profiles_table) trait_col = PkName('trait') trait_col.set_fk(traits_table) ord_col = Num('ord') Table.__init__(self, 'profile_trait', [profile_col, trait_col, ord_col])
def __init__(self, fs_table, disks_table): fs_col = PkName("filesystem") fs_col.set_fk(fs_table) diskname_col = PkName("diskname") diskname_col.set_fk(disks_table) columns = [fs_col, diskname_col] Table.__init__(self, "filesystem_disks", columns)
def __init__(self, profiles_table, traits_table): profile_col = PkName("profile") profile_col.set_fk(profiles_table) trait_col = PkName("trait") trait_col.set_fk(traits_table) ord_col = Num("ord") Table.__init__(self, "profile_trait", [profile_col, trait_col, ord_col])
def __init__(self): idcol = PkNum('fileid') idcol.set_auto_increment('textfile_ident') mcol = Name('md5size') mcol.constraint.unique = True dcol = Text('data') columns = [idcol, mcol, dcol] Table.__init__(self, 'textfiles', columns)
def __init__(self): release_columns = [ PkName('name'), PkName('type'), PkBigname('path'), Num('size'), Name('md5sum')] Table.__init__(self, 'release', release_columns)
def __init__(self, suite, traits_table, prio_table): tablename = ujoin(suite, 'traits') columns = trait_columns() trait = getcolumn('trait', columns) priority = getcolumn('priority', columns) trait.set_fk(traits_table) priority.set_fk(prio_table) Table.__init__(self, tablename, columns)
def __init__(self, suite, traits_table, prio_table): tablename = ujoin(suite, "traits") columns = trait_columns() trait = getcolumn("trait", columns) priority = getcolumn("priority", columns) trait.set_fk(traits_table) priority.set_fk(prio_table) Table.__init__(self, tablename, columns)
def __init__(self): idcol = PkNum("fileid") idcol.set_auto_increment("textfile_ident") mcol = Name("md5size") mcol.constraint.unique = True dcol = Text("data") columns = [idcol, mcol, dcol] Table.__init__(self, "textfiles", columns)
def __init__(self, fs_table, mounts_table): fs_col = PkName("filesystem") fs_col.set_fk(fs_table) mnt_name_col = PkName("mnt_name") mnt_name_col.set_fk(mounts_table) ord_col = Num("ord") partition_column = Num("partition") columns = [fs_col, mnt_name_col, ord_col, partition_column] Table.__init__(self, "filesystem_mounts", columns)
def __init__(self, name, type, section): fullparse_columns = [ PkBigname('package'), PkBigname('name'), Text('value')] type = type.replace('-', '') section = section.replace('-', '') tablename = fullparse_tablename(name, type, section) Table.__init__(self, tablename, fullparse_columns)
def __init__(self, fs_table, mounts_table): fs_col = PkName('filesystem') fs_col.set_fk(fs_table) mnt_name_col = PkName('mnt_name') mnt_name_col.set_fk(mounts_table) ord_col = Num('ord') partition_column = Num('partition') columns = [fs_col, mnt_name_col, ord_col, partition_column] Table.__init__(self, 'filesystem_mounts', columns)
def __init__(self, profiles_table): profile_col = PkName('profile') profile_col.set_fk(profiles_table) trait_col = PkName('trait') name_col = PkBigname('name') value_col = Text('value') cols = [profile_col, trait_col, name_col, value_col] tablename = ujoin('profile', 'variables') Table.__init__(self, tablename, cols)
def __init__(self): source_columns = [ PkName('name'), PkName('type'), Bigname('uri'), Name('suite'), Bigname('remote'), Bigname('srcline')] Table.__init__(self, 'sources', source_columns)
def __init__(self, profiles_table): profile_col = PkName("profile") profile_col.set_fk(profiles_table) trait_col = PkName("trait") name_col = PkBigname("name") value_col = Text("value") cols = [profile_col, trait_col, name_col, value_col] tablename = ujoin("profile", "variables") Table.__init__(self, tablename, cols)
def __init__(self, name, section='__default__'): sourcelist_columns = [ PkBigname('package'), PkBigname('directory'), Name('md5sum'), Num('size'), PkBigname('filename')] section = section.replace('-', '') tablename = list_tablename(name, 'deb-src', section) Table.__init__(self, tablename, sourcelist_columns)
def __init__(self, mach_types_table, kernels_table, profiles_table, filesystem_table): machine_col = PkName("machine") mtype_col = Name("machine_type") mtype_col.set_fk(mach_types_table) kernel_col = Name("kernel") kernel_col.set_fk(kernels_table) profile_col = Name("profile") profile_col.set_fk(profiles_table) fs_col = Name("filesystem") fs_col.set_fk(filesystem_table, "filesystem") columns = [machine_col, mtype_col, kernel_col, profile_col, fs_col] Table.__init__(self, "machines", columns)
def __init__(self, mach_types_table, kernels_table, profiles_table, filesystem_table): machine_col = PkName('machine') mtype_col = Name('machine_type') mtype_col.set_fk(mach_types_table) kernel_col = Name('kernel') kernel_col.set_fk(kernels_table) profile_col = Name('profile') profile_col.set_fk(profiles_table) fs_col = Name('filesystem') fs_col.set_fk(filesystem_table, 'filesystem') columns = [machine_col, mtype_col, kernel_col, profile_col, fs_col] Table.__init__(self, 'machines', columns)
def __init__(self, name, section='__default__'): packagelist_columns = [ PkBigname('package'), Name('priority'), Name('section'), Num('installedsize'), Bigname('maintainer'), Name('architecture'), Name('version'), Bigname('filename'), Num('size'), Name('md5sum'), Text('description')] section = section.replace('-', '') tablename = list_tablename(name, 'deb', section) Table.__init__(self, tablename, packagelist_columns)
def __init__(self): fcol = PkName('family') fcol.set_fk('families') pcol = PkName('parent') pcol.set_fk('families') Table.__init__(self, 'family_parent', [fcol, pcol])
def __init__(self, mounts_table): mnt_name_col = PkName('mnt_name') mnt_name_col.set_fk(mounts_table) partition_col = Num('partition') columns = [mnt_name_col, partition_col] Table.__init__(self, 'partition_mounts', columns)
def __init__(self, name): Table.__init__(self, name, filelist_columns)
def __init__(self, name, mach_types_table): mtype_col = PkName('machine_type') mtype_col.set_fk(mach_types_table) columns = [mtype_col, PkName('module')] Table.__init__(self, name, columns)
def __init__(self, name): Table.__init__(self, name, md5sums_columns)
def __init__(self, name): Table.__init__(self, name, status_columns)
def __init__(self): pcol = PkName('profile') pcol.set_fk('profiles') fcol = PkName('family') fcol.set_fk('families') Table.__init__(self, 'profile_family', [pcol, fcol])
def __init__(self, suite_table): columns = profile_columns() suite = getcolumn('suite', columns) suite.set_fk(suite_table) Table.__init__(self, 'profiles', columns)
def __init__(self): columns = family_env_columns() columns[0].set_fk('families') columns[1].set_fk('traits') Table.__init__(self, 'family_environment', columns)
def __init__(self): fs_col = PkName('filesystem') Table.__init__(self, 'filesystems', [fs_col])
def __init__(self): tcol = PkBigname('template') fcol = Text('templatefile') columns = [tcol] + suiteversion_cols() + [fcol] Table.__init__(self, 'templates', columns)
def __init__(self, name): Table.__init__(self, name, available_columns)
def __init__(self, name, mach_types_table): mtype_col = PkName('machine_type') mtype_col.set_fk(mach_types_table) columns = [mtype_col, PkName('module'), Num('ord')] Table.__init__(self, name, columns)
def __init__(self, name, disks_table): diskname_col = PkName('diskname') diskname_col.set_fk(disks_table) columns = [diskname_col] + partition_columns() Table.__init__(self, name, columns)
def __init__(self, name='kernels'): Table.__init__(self, name, [PkName('kernel')])
def __init__(self, name='mounts'): Table.__init__(self, name, mounts_columns())
def __init__(self, name): cols = [Name('system')] Table.__init__(self, name, system)
def __init__(self, name='machine_types'): Table.__init__(self, name, [PkName('machine_type')])
def __init__(self, name='disks'): Table.__init__(self, name, [PkName('diskname')])
def __init__(self, suite): tablename = ujoin(suite, 'packages') Table.__init__(self, tablename, packages_columns())
def __init__(self): columns = [PkName('family'), Name('type')] Table.__init__(self, 'families', columns)
def __init__(self): columns = family_env_columns() columns[0].set_fk('families') Table.__init__(self, 'family_environment', columns)
def primary_tables(): tables = [] #Textfiles tables.append(TextFilesTable()) #All Suites tables.append(Table('suites', suite_columns())) #All Traits tables.append(PkNameTable('traits', 'trait')) #All Priorities tables.append(PkNameTable('priorities', 'priority')) #All Families tables.append(FamilyTable()) #Family Parents tables.append(FamilyParentsTable()) #Family Environment tables.append(FamilyEnviromentTable()) #All Profiles profiles = ProfileTable('suites') tables.append(profiles) #All Script Names scripts = PkNameTable('scriptnames', 'script') tables.append(scripts) #Profile - Trait relation profile_trait_table = ProfileTrait('profiles', 'traits') tables.append(profile_trait_table) #Profile Environment profile_variables = ProfileEnvironment('profiles') tables.append(profile_variables) #Profile Family tables.append(ProfileFamilyTable()) #Default Environment defaultenv = Table('default_environment', defaultenv_columns()) tables.append(defaultenv) #Current Environment currentenv = Table('current_environment', currentenv_columns()) tables.append(currentenv) #Disks tables.append(DisksTable()) #Machine Types tables.append(MachineTypesTable()) #Mounts tables.append(MountsTable()) #Kernels tables.append(KernelsTable()) #Partitions tables.append(PartitionsTable('partitions', 'disks')) #Partition Workspace pwcols = [PkName('diskname')] + partition_columns() tables.append(Table('partition_workspace', pwcols)) #Machine Disks machine_disks = MachineDisksTable('machine_disks', 'machine_types', 'disks') tables.append(machine_disks) #Machine Modules machine_modules = MachineModulesTable('machine_modules', 'machine_types') tables.append(machine_modules) #Filesystems tables.append(FilesystemsTable()) #Filesystem Mounts tables.append(FilesystemMountsTable('filesystems', 'mounts')) #Filesystem Disks tables.append(FilesystemDisksTable('filesystems', 'disks')) #Machines machines = MachinesTable('machine_types', 'kernels', 'profiles', 'filesystems') tables.append(machines) return tables, dict([(t.name, t) for t in tables])