Ignore:
Timestamp:
Jan 31, 2009, 3:59:00 AM (16 years ago)
Author:
broder
Message:

Conditionalize populating the types table in invirt-database-tables
based on whether the types are in the database already

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-database-server/invirt-database-tables

    r2053 r2054  
    1515    session = database.session()
    1616    session.begin()
    17     session.save(database.Type(type_id='linux-hvm', description='HVM',
    18                                hvm='t', apic='t', acpi='t', pae='t'))
    19     session.save(database.Type(type_id='linux', description='ParaVM',
    20                                hvm='f', apic='f', acpi='f', pae='f'))
     17    if not database.Type.query.get('linux-hvm'):
     18        session.save(database.Type(type_id='linux-hvm', description='HVM',
     19                                   hvm='t', apic='t', acpi='t', pae='t'))
     20    if not database.Type.query.get('linux'):
     21        session.save(database.Type(type_id='linux', description='ParaVM',
     22                                   hvm='f', apic='f', acpi='f', pae='f'))
    2123    session.commit()
    2224
Note: See TracChangeset for help on using the changeset viewer.