Use conductor entity class constant instead of raw string
Now that the conductor base class provides a constant that all entity objects produced from it should provide we can now use that to ensure we are only registering a limited set of entity kinds. Change-Id: I0e71a8da64a228fdc68c9de941aaccf54d493d96
This commit is contained in:
@@ -30,6 +30,7 @@ from oslo_utils import timeutils
|
|||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from taskflow.conductors import base as c_base
|
||||||
from taskflow import exceptions as excp
|
from taskflow import exceptions as excp
|
||||||
from taskflow.jobs import base
|
from taskflow.jobs import base
|
||||||
from taskflow import logging
|
from taskflow import logging
|
||||||
@@ -566,7 +567,7 @@ class ZookeeperJobBoard(base.NotifyingJobBoard):
|
|||||||
|
|
||||||
def register_entity(self, entity):
|
def register_entity(self, entity):
|
||||||
entity_type = entity.kind
|
entity_type = entity.kind
|
||||||
if entity_type == 'conductor':
|
if entity_type == c_base.Conductor.ENTITY_KIND:
|
||||||
entity_path = k_paths.join(self.entity_path, entity_type)
|
entity_path = k_paths.join(self.entity_path, entity_type)
|
||||||
self._client.ensure_path(entity_path)
|
self._client.ensure_path(entity_path)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user