← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1539402] Re: Refactoring required in nova/tests/unit/db/test_migrations.py

 

Please don't file refactoring issues as bugs

** Changed in: nova
       Status: In Progress => Won't Fix

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1539402

Title:
  Refactoring required in nova/tests/unit/db/test_migrations.py

Status in OpenStack Compute (nova):
  Won't Fix

Bug description:
  In nova/tests/unit/db/test_migrations.py,

  We can use constant for Text, String, Integer, DateTime type constant
  like

      Text_TYPE = sqlalchemy.types.Text
      String_TYPE = sqlalchemy.types.String
      Integer_TYPE = sqlalchemy.types.Integer
      DateTime_TYPE = sqlalchemy.types.DateTime

  
  Currently it is directly used as 

          self.assertIsInstance(shadow_instance_extra.c.vcpu_model.type,
                                sqlalchemy.type.Text)
          self.assertIsInstance(key_pairs.c.type.type,
                                sqlalchemy.types.String)
          self.assertIsInstance(pci_devices.c.numa_node.type,
                                sqlalchemy.types.Integer)
          self.assertIsInstance(services.c.last_seen_up.type,
                                sqlalchemy.types.DateTime)

  It should be

          self.assertIsInstance(shadow_instance_extra.c.vcpu_model.type,
                                self.Text_TYPE)
           self.assertIsInstance(shadow_pci_devices.c.parent_addr.type,
                                self.String_TYPE)
          self.assertIsInstance(shadow_instance_extra.c.vcpu_model.type,
                                self.Integer_TYPE)
          self.assertIsInstance(shadow_services.c.last_seen_up.type,
                                self.DateTime_TYPE)

  
  These changes are suggested in a separate bug (https://bugs.launchpad.net/cinder/+bug/1528989) for cinder and I found them in Nova too. Updating for a better visibility of the code.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1539402/+subscriptions


References