Repository: pulp/pulpcore

Issue:
[noissue]: Update psycopg2 requirement from <2.9.6,>=2.9.3 to >=2.9.3,<2.9.7
Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/psycopg/psycopg2/blob/master/NEWS">psycopg2's changelog</a>.</em></p>
<blockquote>
<h2>Current release</h2>
<p>What's new in psycopg 2.9.6
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Package manylinux 2014 for aarch64 and ppc64le platforms, in order to
include libpq 15 in the binary package (:ticket:<code>[#1396](https://github.com/psycopg/psycopg2/issues/1396)</code>).</li>
<li>Wheel package compiled against OpenSSL 1.1.1t.</li>
</ul>
<p>What's new in psycopg 2.9.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Add support for Python 3.11.</li>
<li>Add support for rowcount in MERGE statements in binary packages
(:ticket:<code>[#1497](https://github.com/psycopg/psycopg2/issues/1497)</code>).</li>
<li>Wheel package compiled against OpenSSL 1.1.1r and PostgreSQL 15 libpq.</li>
</ul>
<p>What's new in psycopg 2.9.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fix <code>~psycopg2.extras.register_composite()</code>,
<code>~psycopg2.extras.register_range()</code> with customized :sql:<code>search_path</code>
(:ticket:<code>[#1487](https://github.com/psycopg/psycopg2/issues/1487)</code>).</li>
<li>Handle correctly composite types with names or in schemas requiring escape.</li>
<li>Find <code>pg_service.conf</code> file in the <code>/etc/postgresql-common</code> directory in
binary packages (:ticket:<code>[#1365](https://github.com/psycopg/psycopg2/issues/1365)</code>).</li>
<li><code>~psycopg2.errorcodes</code> map and <code>~psycopg2.errors</code> classes updated to
PostgreSQL 15.</li>
<li>Wheel package compiled against OpenSSL 1.1.1q and PostgreSQL 14.4 libpq.</li>
</ul>
<p>What's new in psycopg 2.9.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Alpine (musl) wheels now available (:ticket:<code>[#1392](https://github.com/psycopg/psycopg2/issues/1392)</code>).</li>
<li>macOS arm64 (Apple M1) wheels now available (:ticket:<code>1482</code>).</li>
</ul>
<p>What's new in psycopg 2.9.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Raise <code>ValueError</code> for dates &gt;= Y10k (:ticket:<code>[#1307](https://github.com/psycopg/psycopg2/issues/1307)</code>).</li>
<li><code>~psycopg2.errorcodes</code> map and <code>~psycopg2.errors</code> classes updated to
PostgreSQL 14.</li>
<li>Add preliminary support for Python 3.11 (:tickets:<code>[#1376](https://github.com/psycopg/psycopg2/issues/1376), [#1386](https://github.com/psycopg/psycopg2/issues/1386)</code>).</li>
<li>Wheel package compiled against OpenSSL 1.1.1l and PostgreSQL 14.1 libpq
(:ticket:<code>[#1388](https://github.com/psycopg/psycopg2/issues/1388)</code>).</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/psycopg/psycopg2/commits/2.9.6">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Discussion:

Resolving patch:
diff --git a/pulpcore/app/models/task.py b/pulpcore/app/models/task.py
--- a/pulpcore/app/models/task.py
+++ b/pulpcore/app/models/task.py
@@ -121,7 +121,7 @@ def get_unreserved_worker(self):
             Worker.DoesNotExist: If all Workers have at least one ReservedResource entry.
         """
         workers_qs = self.online_workers().exclude(
-            name__startswith=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME
+            name=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME
         )
         workers_qs_with_counts = workers_qs.annotate(models.Count('reservations'))
         try:
@@ -215,7 +215,7 @@ def resource_managers(self):
             :class:`django.db.models.query.QuerySet`:  A query set of the Worker objects which
                 which match the resource manager name.
         """
-        return self.filter(name__startswith=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME)
+        return self.filter(name=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME)
 
 
 class Worker(Model):
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
@@ -75,10 +75,10 @@ def check_worker_processes():
         mark_worker_offline(worker.name)
 
     worker_count = Worker.objects.online_workers().exclude(
-        name__startswith=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME).count()
+        name=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME).count()
 
     resource_manager_count = Worker.objects.online_workers().filter(
-        name__startswith=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME).count()
+        name=TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME).count()
 
     if resource_manager_count == 0:
         msg = _("There are 0 pulpcore-resource-manager processes running. Pulp will not operate "
diff --git a/pulpcore/tasking/worker.py b/pulpcore/tasking/worker.py
--- a/pulpcore/tasking/worker.py
+++ b/pulpcore/tasking/worker.py
@@ -54,7 +54,7 @@ def __init__(self, queues, **kwargs):
         else:
             kwargs['name'] = "{pid}@{hostname}".format(pid=os.getpid(), hostname=socket.getfqdn())
 
-        if kwargs['name'].startswith(TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME):
+        if kwargs['name'] == TASKING_CONSTANTS.RESOURCE_MANAGER_WORKER_NAME:
             queues = [Queue('resource-manager', connection=kwargs['connection'])]
         else:
             queues = [Queue(kwargs['name'], connection=kwargs['connection'])]


Test patch: