Francesco Romani has uploaded a new change for review.

Change subject: virt: move valid states list in vmstatus.py
......................................................................

virt: move valid states list in vmstatus.py

It is a more fitting place.
Only code movement.

Change-Id: I69b09501ac3984bdb59db31a48fd582d06975e3e
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M lib/vdsm/virt/vmstatus.py
M vdsm/virt/vm.py
2 files changed, 6 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/65538/1

diff --git a/lib/vdsm/virt/vmstatus.py b/lib/vdsm/virt/vmstatus.py
index c689554..df41558 100644
--- a/lib/vdsm/virt/vmstatus.py
+++ b/lib/vdsm/virt/vmstatus.py
@@ -32,3 +32,8 @@
 WAIT_FOR_LAUNCH = 'WaitForLaunch'
 
 PAUSED_STATES = (POWERING_DOWN, REBOOT_IN_PROGRESS, UP)
+
+
+VALID_STATES = (UP, DOWN, MIGRATION_SOURCE, MIGRATION_DESTINATION,
+                PAUSED, POWERING_DOWN, POWERING_UP, REBOOT_IN_PROGRESS,
+                RESTORING_STATE, SAVING_STATE, WAIT_FOR_LAUNCH)
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 43dc775..cbcc037 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -114,13 +114,6 @@
     pass
 
 
-VALID_STATES = (vmstatus.DOWN, vmstatus.MIGRATION_DESTINATION,
-                vmstatus.MIGRATION_SOURCE, vmstatus.PAUSED,
-                vmstatus.POWERING_DOWN, vmstatus.REBOOT_IN_PROGRESS,
-                vmstatus.RESTORING_STATE, vmstatus.SAVING_STATE,
-                vmstatus.UP, vmstatus.WAIT_FOR_LAUNCH)
-
-
 class ConsoleDisconnectAction:
     NONE = 'NONE'
     LOCK_SCREEN = 'LOCK_SCREEN'
@@ -335,7 +328,7 @@
                     raise DoubleDownError
                 else:
                     return
-            if value not in VALID_STATES:
+            if value not in vmstatus.VALID_STATES:
                 self.log.error('setting state to %s', value)
             if self._lastStatus != value:
                 self.saveState()


-- 
To view, visit https://gerrit.ovirt.org/65538
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69b09501ac3984bdb59db31a48fd582d06975e3e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to