Import consts from rally_openstack instead of rally

Change-Id: Ic292b5148aa272296a69fef4af44b0db36c91553
This commit is contained in:
chenhb 2018-09-13 15:34:04 +08:00
parent e02c28600f
commit 0eb8c3c218
4 changed files with 3 additions and 98 deletions

View File

@ -27,54 +27,6 @@ from rally.common import utils
JSON_SCHEMA = "http://json-schema.org/draft-04/schema" JSON_SCHEMA = "http://json-schema.org/draft-04/schema"
class _TaskStatus(utils.ImmutableMixin, utils.EnumMixin):
"""Consts that represents task possible states."""
INIT = "init"
VALIDATING = "validating"
VALIDATED = "validated"
VALIDATION_FAILED = "validation_failed"
RUNNING = "running"
FINISHED = "finished"
CRASHED = "crashed"
ABORTING = "aborting"
SLA_FAILED = "sla_failed"
SOFT_ABORTING = "soft_aborting"
ABORTED = "aborted"
PAUSED = "paused"
class _SubtaskStatus(utils.ImmutableMixin, utils.EnumMixin):
"""Consts that represents task possible states."""
INIT = "init"
VALIDATING = "validating"
VALIDATED = "validated"
VALIDATION_FAILED = "validation_failed"
RUNNING = "running"
FINISHED = "finished"
CRASHED = "crashed"
ABORTING = "aborting"
SLA_FAILED = "sla_failed"
SOFT_ABORTING = "soft_aborting"
ABORTED = "aborted"
PAUSED = "paused"
class _DeployStatus(utils.ImmutableMixin, utils.EnumMixin):
DEPLOY_INIT = "deploy->init"
DEPLOY_STARTED = "deploy->started"
DEPLOY_SUBDEPLOY = "deploy->subdeploy"
DEPLOY_FINISHED = "deploy->finished"
DEPLOY_FAILED = "deploy->failed"
DEPLOY_INCONSISTENT = "deploy->inconsistent"
CLEANUP_STARTED = "cleanup->started"
CLEANUP_FINISHED = "cleanup->finished"
CLEANUP_FAILED = "cleanup->failed"
class _EndpointPermission(utils.ImmutableMixin, utils.EnumMixin): class _EndpointPermission(utils.ImmutableMixin, utils.EnumMixin):
ADMIN = "admin" ADMIN = "admin"
USER = "user" USER = "user"
@ -180,54 +132,7 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
return self.__names[service_type] return self.__names[service_type]
class _HookStatus(utils.ImmutableMixin, utils.EnumMixin):
"""Hook result statuses."""
SUCCESS = "success"
FAILED = "failed"
VALIDATION_FAILED = "validation_failed"
class _TagType(utils.ImmutableMixin, utils.EnumMixin):
TASK = "task"
SUBTASK = "subtask"
VERIFICATION = "verification"
class _VerifierStatus(utils.ImmutableMixin, utils.EnumMixin):
"""Verifier statuses."""
INIT = "init"
INSTALLING = "installing"
INSTALLED = "installed"
UPDATING = "updating"
EXTENDING = "extending"
FAILED = "failed"
# NOTE(andreykurilin): In case of updating these statuses, please do not forget
# to update doc reference too
class _VerificationStatus(utils.ImmutableMixin, utils.EnumMixin):
"""Verification statuses."""
INIT = "init"
RUNNING = "running"
FINISHED = "finished"
FAILED = "failed"
CRASHED = "crashed"
class _TimeFormat(utils.ImmutableMixin, utils.EnumMixin):
"""International time formats"""
ISO8601 = "%Y-%m-%dT%H:%M:%S%z"
TaskStatus = _TaskStatus()
SubtaskStatus = _SubtaskStatus()
DeployStatus = _DeployStatus()
EndpointPermission = _EndpointPermission() EndpointPermission = _EndpointPermission()
ServiceType = _ServiceType() ServiceType = _ServiceType()
Service = _Service() Service = _Service()
EndpointType = _EndpointType() EndpointType = _EndpointType()
HookStatus = _HookStatus()
TagType = _TagType()
VerifierStatus = _VerifierStatus()
VerificationStatus = _VerificationStatus()
TimeFormat = _TimeFormat()

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import consts
from rally.task import validation from rally.task import validation
from rally_openstack import consts
from rally_openstack import scenario from rally_openstack import scenario
from rally_openstack.scenarios.gnocchi import utils as gnocchiutils from rally_openstack.scenarios.gnocchi import utils as gnocchiutils

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import consts
from rally.task import validation from rally.task import validation
from rally_openstack import consts
from rally_openstack import scenario from rally_openstack import scenario
from rally_openstack.scenarios.gnocchi import utils as gnocchiutils from rally_openstack.scenarios.gnocchi import utils as gnocchiutils

View File

@ -18,9 +18,9 @@ import ddt
import mock import mock
import os_faults import os_faults
from os_faults.api import error from os_faults.api import error
from rally import consts
from rally.task import hook from rally.task import hook
from rally_openstack import consts
from rally_openstack.hook import fault_injection from rally_openstack.hook import fault_injection
from tests.unit import fakes from tests.unit import fakes
from tests.unit import test from tests.unit import test