Repository: pulp/pulpcore

Issue:
[PR #4540/671f2074 backport][3.21] More export optimizations and a bugfix
**This is a backport of PR #4540 as merged into main (671f2074716e509ea83d90afa1fea013d6de0668).**

None


Discussion:

Resolving patch:
diff --git a/pulpcore/tasking/services/manage_workers.py b/pulpcore/tasking/services/manage_workers.py
--- a/pulpcore/tasking/services/manage_workers.py
+++ b/pulpcore/tasking/services/manage_workers.py
@@ -10,7 +10,7 @@
 
 _ENVIRONMENT_FILE = os.path.join('/', 'etc', 'default', 'pulp-workers')
 _SYSTEMD_UNIT_PATH = os.path.join('/', 'run', 'systemd', 'system')
-_UNIT_FILENAME_TEMPLATE = 'pulp-worker-%s.service'
+_UNIT_FILENAME_TEMPLATE = 'pulpcore-worker-%s.service'
 _WORKER_TEMPLATE = """[Unit]
 Description=Pulp Worker #%(num)s
 After=network.target
diff --git a/pulpcore/tasking/services/worker_watcher.py b/pulpcore/tasking/services/worker_watcher.py
--- a/pulpcore/tasking/services/worker_watcher.py
+++ b/pulpcore/tasking/services/worker_watcher.py
@@ -64,7 +64,7 @@ def check_worker_processes():
     present. If there are zero of either, log at the error level that Pulp will not operate
     correctly.
     """
-    msg = _('Checking if pulp-workers or pulp-resource-manager processes are '
+    msg = _('Checking if pulpcore-workers or pulpcore-resource-manager processes are '
             'missing for more than %d seconds') % TASKING_CONSTANTS.WORKER_TTL
     _logger.debug(msg)
 
@@ -81,8 +81,8 @@ def check_worker_processes():
         name__startswith=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME).count()
 
     if resource_manager_count == 0:
-        msg = _("There are 0 pulp-resource-manager processes running. Pulp will not operate "
-                "correctly without at least one pulp-resource-mananger process running.")
+        msg = _("There are 0 pulpcore-resource-manager processes running. Pulp will not operate "
+                "correctly without at least one pulpcore-resource-mananger process running.")
         _logger.error(msg)
 
     if worker_count == 0:
@@ -91,8 +91,8 @@ def check_worker_processes():
         _logger.error(msg)
 
     output_dict = {'workers': worker_count, 'resource-manager': resource_manager_count}
-    msg = _("%(workers)d pulp-worker processes and %(resource-manager)d "
-            "pulp-resource-manager processes") % output_dict
+    msg = _("%(workers)d pulpcore-worker processes and %(resource-manager)d "
+            "pulpcore-resource-manager processes") % output_dict
     _logger.debug(msg)
 
 


Test patch:
diff --git a/pulpcore/tests/functional/api/test_workers.py b/pulpcore/tests/functional/api/test_workers.py
--- a/pulpcore/tests/functional/api/test_workers.py
+++ b/pulpcore/tests/functional/api/test_workers.py
@@ -123,14 +123,14 @@ def setUpClass(cls):
         cls.client = api.Client(cls.cfg, api.json_handler)
         cls.svc_mgr = cli.ServiceManager(cls.cfg, cls.cfg.get_hosts('api')[0])
         cls.worker = {}
-        if not cls.svc_mgr.is_active(['pulp-worker@*']):
+        if not cls.svc_mgr.is_active(['pulpcore-worker@*']):
             raise unittest.SkipTest(
                 'These tests require pulp workers running on systemd'
             )
 
     def test_01_start_new_worker(self):
         """Start a new worker to be used in next assertions."""
-        self.svc_mgr.start(['pulp-worker@99'])
+        self.svc_mgr.start(['pulpcore-worker@99'])
         time.sleep(2)
         workers = self.client.get(
             WORKER_PATH, params={'online': True}
@@ -145,7 +145,7 @@ def test_01_start_new_worker(self):
     @skip_if(bool, 'worker', False)
     def test_02_stop_worker(self):
         """Stop the worker and assert it is offline."""
-        self.svc_mgr.stop(['pulp-worker@99'])
+        self.svc_mgr.stop(['pulpcore-worker@99'])
         time.sleep(2)
         worker = self.client.get(self.worker['_href'])
         self.assertEqual(worker['online'], False)