Esempio n. 1
0
def InstancePatchMain():
    Instance.__new__ = instance_patch_new
    InstanceList.__new__ = instance_list_patch_new
    InstanceModel.workload_type = Column(String(100), nullable=True)
    InstanceModel.policy = Column(Integer(11), nullable=True)
    obj = InstanceMigrationPatch()
    migrate_engine = session.get_engine()
    try:
        obj.upgrade_instance_table(migrate_engine)
    except Exception as e:
        LOG.warn(_("Upgrading instance_table - %s"), e)  
Esempio n. 2
0
 def ins_wrap(self):
     if not set(dialects).issubset(ALLOWED_DIALECTS):
         raise ValueError("Please use allowed dialects: %s" %
                          ALLOWED_DIALECTS)
     engine = session.get_engine()
     if engine.name not in dialects:
         msg = ('The test "%s" can be run '
                'only on %s. Current engine is %s.')
         args = (f.__name__, ' '.join(dialects), engine.name)
         self.skip(msg % args)
     else:
         return f(self)
Esempio n. 3
0
 def ins_wrap(self):
     if not set(dialects).issubset(ALLOWED_DIALECTS):
         raise ValueError(
             "Please use allowed dialects: %s" % ALLOWED_DIALECTS)
     engine = session.get_engine()
     if engine.name not in dialects:
         msg = ('The test "%s" can be run '
                'only on %s. Current engine is %s.')
         args = (f.__name__, ' '.join(dialects), engine.name)
         self.skip(msg % args)
     else:
         return f(self)
Esempio n. 4
0
def PciDevicePatchMain():
    PciDevice.__new__ = pci_device_patch_new
    PciDeviceList.__new__ = pci_device_list_patch_new

    PciDeviceModel.bus = Column(String(2), nullable=False)
    PciDeviceModel.slot = Column(String(2), nullable=False)
    PciDeviceModel.function = Column(String(2), nullable=False)
    PciDeviceModel.workload = Column(String(2), nullable=True)
    obj = PciTableMigrationPatch()
    migrate_engine = session.get_engine()
        
    try:
        obj.upgrade_pci_device_table(migrate_engine)
    except Exception as e:
        LOG.warn(_("Upgrading pci_device_table - %s"), e)