From 3487aad6c89acd045da2315c1547df0d4d708693 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 09:17:03 +0200 Subject: [PATCH] chore(deps): update dependency ops to v2.13.0 (#152) * chore(deps): update dependency ops to v2.13.0 * fix linting * fix linting --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: arturo-seijas <102022572+arturo-seijas@users.noreply.github.com> Co-authored-by: Arturo Seijas Co-authored-by: Yanks Yoon <37652070+yanksyoon@users.noreply.github.com> --- requirements.txt | 2 +- src-docs/agent.py.md | 20 ++------------------ src/agent.py | 16 +--------------- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/requirements.txt b/requirements.txt index 58e117b4..4c95ff02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ cosl==0.0.11 jenkinsapi==0.3.13 jsonschema==4.22.0 -ops==2.12.0 +ops==2.13.0 pydantic==1.10.15 requests==2.32.2 diff --git a/src-docs/agent.py.md b/src-docs/agent.py.md index f745235b..d74ba33c 100644 --- a/src-docs/agent.py.md +++ b/src-docs/agent.py.md @@ -12,22 +12,6 @@ The Jenkins agent relation observer. - **JENKINS_SERVICE_NAME** ---- - -## class `AgentRelationData` -Relation data required for adding the Jenkins agent. - - - -**Attributes:** - - - `url`: The Jenkins server url. - - `secret`: The secret for agent node. - - - - - --- ## class `Observer` @@ -39,7 +23,7 @@ The Jenkins agent relation observer. - `agent_discovery_url`: external hostname to be passed to agents for discovery. - + ### function `__init__` @@ -87,7 +71,7 @@ Shortcut for more simple access the model. --- - + ### function `reconfigure_agent_discovery` diff --git a/src/agent.py b/src/agent.py index 764d9c30..3d9c27bd 100644 --- a/src/agent.py +++ b/src/agent.py @@ -17,18 +17,6 @@ logger = logging.getLogger(__name__) -class AgentRelationData(typing.TypedDict): - """Relation data required for adding the Jenkins agent. - - Attributes: - url: The Jenkins server url. - secret: The secret for agent node. - """ - - url: str - secret: str - - class Observer(ops.Object): """The Jenkins agent relation observer. @@ -146,9 +134,7 @@ def _on_deprecated_agent_relation_joined(self, event: ops.RelationJoinedEvent) - return jenkins_url = self.agent_discovery_url - event.relation.data[self.model.unit].update( - AgentRelationData(url=jenkins_url, secret=secret) - ) + event.relation.data[self.model.unit].update({"url": jenkins_url, "secret": secret}) self.charm.unit.status = ops.ActiveStatus() def _on_agent_relation_joined(self, event: ops.RelationJoinedEvent) -> None: