Skip to content

Commit

Permalink
chore(deps): update dependency ops to v2.13.0 (#152)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Arturo Seijas <[email protected]>
Co-authored-by: Yanks Yoon <[email protected]>
  • Loading branch information
4 people committed May 24, 2024
1 parent fd3d4bc commit 3487aad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
20 changes: 2 additions & 18 deletions src-docs/agent.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@ The Jenkins agent relation observer.
- **JENKINS_SERVICE_NAME**


---

## <kbd>class</kbd> `AgentRelationData`
Relation data required for adding the Jenkins agent.



**Attributes:**

- <b>`url`</b>: The Jenkins server url.
- <b>`secret`</b>: The secret for agent node.





---

## <kbd>class</kbd> `Observer`
Expand All @@ -39,7 +23,7 @@ The Jenkins agent relation observer.

- <b>`agent_discovery_url`</b>: external hostname to be passed to agents for discovery.

<a href="../src/agent.py#L39"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/agent.py#L27"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -87,7 +71,7 @@ Shortcut for more simple access the model.

---

<a href="../src/agent.py#L248"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/agent.py#L234"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `reconfigure_agent_discovery`

Expand Down
16 changes: 1 addition & 15 deletions src/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3487aad

Please sign in to comment.