centralize all migration status together
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Triaged
|
Low
|
Unassigned |
Bug Description
now the migration status in nova is hard-code.
They are defined arbitrary.
Such as, we need a "cancelled" status, then we defined it where where want.
1. firstly
this is not a good program style.
2. this is error prone.
such as we need a list of in-progress status migrations.
we need to do the follow command to summarize all migration status firstly.
this is easy to missing some status.
$ git grep "mig.*status"
......
nova/compute/
nova/compute/
nova/compute/
nova/compute/
nova/compute/
nova/compute/
nova/compute/
nova/compute/
......
Changed in nova: | |
assignee: | nobody → lvmxh (shaohef) |
Changed in nova: | |
assignee: | lvmxh (shaohef) → nobody |
we need to clean up these migration status.
an ideal solution
we define a new file such as status.py
def class MigeationStatus (Object) :
ERROR=' error'
RUNNING= "running"
.......
This is just a simple.
Then clean up all files using migration.status hard code.
$ git grep "mig.*status" | grep .py |awk '{print $1}' |sort | uniq openstack/ compute/ server_ migrations. py: api.py: manager. py: resource_ tracker. py: manager. py: tasks/live_ migrate. py: sqlalchemy/ api.py: def sqlalchemy/ migrate_ repo/versions/ 216_havana. py: sqlalchemy/ models. py: migration. py: functional/ api_sample_ tests/test_ server_ migrations. py: unit/api/ openstack/ compute/ test_server_ migrations. py: unit/compute/ test_compute. py: unit/compute/ test_compute_ api.py: unit/compute/ test_compute_ mgr.py: unit/compute/ test_resource_ tracker. py: unit/conductor/ tasks/test_ live_migrate. py: unit/conductor/ test_conductor. py: unit/db/ test_db_ api.py: unit/objects/ test_migration. py: libvirt/ driver. py:
nova/api/
nova/compute/
nova/compute/
nova/compute/
nova/conductor/
nova/conductor/
nova/db/api.py:
nova/db/api.py:def
nova/db/
nova/db/
nova/db/
nova/objects/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/tests/
nova/virt/