diff --git a/doc/source/contributor/manual-tests.rst b/doc/source/contributor/manual-tests.rst index 82f679730..bc6ffa8ad 100644 --- a/doc/source/contributor/manual-tests.rst +++ b/doc/source/contributor/manual-tests.rst @@ -61,14 +61,14 @@ Services Information +----------------------------------+------------+-------------+---------------------------+ | Name | Process Id | Hostname | Created At | +----------------------------------+------------+-------------+---------------------------+ - | ApiWorker worker(0) | 1084 | my-devstack | 2019-03-13T14:31:46+00:00 | - | EvaluatorWorker worker(0) | 1082 | my-devstack | 2019-03-13T14:31:46+00:00 | - | MachineLearningService worker(0) | 5956 | my-devstack | 2019-03-13T10:30:54+00:00 | - | PersistorService worker(0) | 22536 | my-devstack | 2019-03-13T14:14:15+00:00 | - | SnmpParsingService worker(0) | 6170 | my-devstack | 2019-03-13T10:30:56+00:00 | - | VitrageNotifierService worker(0) | 22746 | my-devstack | 2019-03-13T14:14:27+00:00 | - | vitrageuWSGI worker 1 | 2847 | my-devstack | 2019-03-13T10:30:47+00:00 | - | vitrageuWSGI worker 2 | 2848 | my-devstack | 2019-03-13T10:30:47+00:00 | + | ApiWorker_worker_0 | 1084 | my-devstack | 2019-03-13T14:31:46+00:00 | + | EvaluatorWorker_worker_0 | 1082 | my-devstack | 2019-03-13T14:31:46+00:00 | + | MachineLearningService_worker_0 | 5956 | my-devstack | 2019-03-13T10:30:54+00:00 | + | PersistorService_worker_0 | 22536 | my-devstack | 2019-03-13T14:14:15+00:00 | + | SnmpParsingService_worker_0 | 6170 | my-devstack | 2019-03-13T10:30:56+00:00 | + | VitrageNotifierService_worker_0 | 22746 | my-devstack | 2019-03-13T14:14:27+00:00 | + | vitrageuWSGI_worker_1 | 2847 | my-devstack | 2019-03-13T10:30:47+00:00 | + | vitrageuWSGI_worker_2 | 2848 | my-devstack | 2019-03-13T10:30:47+00:00 | +----------------------------------+------------+-------------+---------------------------+ Processes diff --git a/doc/source/contributor/vitrage-api.rst b/doc/source/contributor/vitrage-api.rst index 3c91ef3db..c96a0a755 100644 --- a/doc/source/contributor/vitrage-api.rst +++ b/doc/source/contributor/vitrage-api.rst @@ -1962,49 +1962,49 @@ Response Examples "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23161, - "Name": "ApiWorker worker(0)" + "Name": "ApiWorker_worker_0" }, { "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23153, - "Name": "EvaluatorWorker worker(0)" + "Name": "EvaluatorWorker_worker_0" }, { "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23155, - "Name": "EvaluatorWorker worker(1)" + "Name": "EvaluatorWorker_worker_1" }, { "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23157, - "Name": "EvaluatorWorker worker(2)" + "Name": "EvaluatorWorker_worker_2" }, { "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23158, - "Name": "EvaluatorWorker worker(3)" + "Name": "EvaluatorWorker_worker_3" }, { "Created At": "2019-02-10T11:07:33+00:00", "Hostname": "controller-1", "Process Id": 23366, - "Name": "MachineLearningService worker(0)" + "Name": "MachineLearningService_worker_0" }, { "Created At": "2019-02-10T11:07:35+00:00", "Hostname": "controller-1", "Process Id": 23475, - "Name": "PersistorService worker(0)" + "Name": "PersistorService_worker_0" }, { "Created At": "2019-02-10T11:07:15+00:00", "Hostname": "controller-1", "Process Id": 23164, - "Name": "SnmpParsingService worker(0)" + "Name": "SnmpParsingService_worker_0" }, { "Created At": "2019-02-10T11:14:30+00:00", @@ -2022,7 +2022,7 @@ Response Examples "Created At": "2019-02-10T11:07:32+00:00", "Hostname": "controller-1", "Process Id": 23352, - "Name": "VitrageNotifierService worker(0)" + "Name": "VitrageNotifierService_worker_0" } ] diff --git a/releasenotes/notes/services_name_format-6868c6f792580328.yaml b/releasenotes/notes/services_name_format-6868c6f792580328.yaml new file mode 100644 index 000000000..cd700be3d --- /dev/null +++ b/releasenotes/notes/services_name_format-6868c6f792580328.yaml @@ -0,0 +1,5 @@ +--- +other: + - | + Service ``Name`` field has changed format and now separated + with underscores rather then whitespaces. diff --git a/vitrage/coordination/coordination.py b/vitrage/coordination/coordination.py index 1aab22223..1369709c1 100644 --- a/vitrage/coordination/coordination.py +++ b/vitrage/coordination/coordination.py @@ -30,7 +30,7 @@ LOG = log.getLogger(__name__) class Coordinator(object): def __init__(self, my_id=None): self.backend_url = CONF.coordination.backend_url - self.my_id = my_id or ' '.join(psutil.Process(os.getpid()).cmdline()) + self.my_id = my_id or '_'.join(psutil.Process(os.getpid()).cmdline()) self.coordinator = None if self.backend_url: self.coordinator = tooz.coordination.get_coordinator( diff --git a/vitrage/coordination/service.py b/vitrage/coordination/service.py index 607ee8136..d8b1558c3 100644 --- a/vitrage/coordination/service.py +++ b/vitrage/coordination/service.py @@ -21,8 +21,8 @@ class Service(cotyledon.Service): def __init__(self, worker_id): super(Service, self).__init__(worker_id) - self.coordinator = Coordinator('%s worker(%s)' % (self.name, - worker_id)) + self.coordinator = Coordinator('%s_worker_%s' % (self.name, + worker_id)) def run(self): self.coordinator.start()