Skip to content

Commit

Permalink
Merge branch 'main' into TELCO-889_remove-defer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Beierl authored Feb 14, 2024
2 parents 1a9b607 + 1d4e46c commit 7ae436f
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
needs-publishing: ${{ steps.changes.outputs.fiveg_nrf }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
Expand Down
6 changes: 3 additions & 3 deletions lib/charms/sdcore_nrf_k8s/v0/fiveg_nrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DummyFiveGNRFRequirerCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.nrf_requirer = NRFRequires(self, "fiveg-nrf")
self.nrf_requirer = NRFRequires(self, "fiveg_nrf")
self.framework.observe(self.nrf_requirer.on.nrf_available, self._on_nrf_available)
def _on_nrf_available(self, event: NRFAvailableEvent):
Expand Down Expand Up @@ -67,7 +67,7 @@ class DummyFiveGNRFProviderCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.nrf_provider = NRFProvides(self, "fiveg-nrf")
self.nrf_provider = NRFProvides(self, "fiveg_nrf")
self.framework.observe(
self.on.fiveg_nrf_relation_joined, self._on_fiveg_nrf_relation_joined
)
Expand Down Expand Up @@ -110,7 +110,7 @@ def _on_nrf_url_changed(

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 1
LIBPATCH = 2

PYDEPS = ["pydantic", "pytest-interface-tester"]

Expand Down
8 changes: 4 additions & 4 deletions lib/charms/tls_certificates_interface/v3/tls_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _on_all_certificates_invalidated(self, event: AllCertificatesInvalidatedEven

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 0
LIBPATCH = 1

PYDEPS = ["cryptography", "jsonschema"]

Expand Down Expand Up @@ -707,7 +707,7 @@ def generate_ca(
private_key_object = serialization.load_pem_private_key(
private_key, password=private_key_password
)
subject = issuer = x509.Name(
subject_name = x509.Name(
[
x509.NameAttribute(x509.NameOID.COUNTRY_NAME, country),
x509.NameAttribute(x509.NameOID.COMMON_NAME, subject),
Expand All @@ -730,8 +730,8 @@ def generate_ca(
)
cert = (
x509.CertificateBuilder()
.subject_name(subject)
.issuer_name(issuer)
.subject_name(subject_name)
.issuer_name(subject_name)
.public_key(private_key_object.public_key()) # type: ignore[arg-type]
.serial_number(x509.random_serial_number())
.not_valid_before(datetime.utcnow())
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ requires:
interface: tls-certificates

provides:
fiveg-nrf:
fiveg_nrf:
interface: fiveg_nrf

assumes:
Expand Down
4 changes: 2 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DATABASE_NAME = "free5gc"
NRF_SBI_PORT = 29510
DATABASE_RELATION_NAME = "database"
NRF_RELATION_NAME = "fiveg-nrf"
NRF_RELATION_NAME = "fiveg_nrf"
CERTS_DIR_PATH = "/support/TLS" # Certificate paths are hardcoded in NRF code
PRIVATE_KEY_NAME = "nrf.key"
CSR_NAME = "nrf.csr"
Expand Down Expand Up @@ -344,7 +344,7 @@ def _config_file_content_matches(self, content: str) -> bool:
return True

def _on_fiveg_nrf_relation_joined(self, event: RelationJoinedEvent) -> None:
"""Handle fiveg-nrf relation joined event.
"""Handle fiveg_nrf relation joined event.
Args:
event: RelationJoinedEvent
Expand Down
2 changes: 1 addition & 1 deletion terraform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ output "certificates_endpoint" {

output "fiveg_nrf_endpoint" {
description = "Name of the endpoint to provide fiveg_nrf interface."
value = "fiveg-nrf"
value = "fiveg_nrf"
}
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coverage[toml]
flake8-docstrings
flake8-builtins
isort
juju>=3.1
juju==3.3.0.0
macaroonbakery==1.3.4 # https://protobuf.dev/news/2022-05-06/#python-updates
mypy
pep8-naming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ summary: |
Dummy SD-Core NRF provider charm.
provides:
fiveg-nrf:
interface: fiveg-nrf
fiveg_nrf:
interface: fiveg_nrf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DummyFiveGNRFProviderCharm(CharmBase):
def __init__(self, *args):
"""Init."""
super().__init__(*args)
self.nrf_provider = NRFProvides(self, "fiveg-nrf")
self.nrf_provider = NRFProvides(self, "fiveg_nrf")
self.framework.observe(
self.on.fiveg_nrf_relation_joined, self._on_fiveg_nrf_relation_joined
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ summary: |
Dummy SD-Core NRF requirer charm.
requires:
fiveg-nrf:
interface: fiveg-nrf
fiveg_nrf:
interface: fiveg_nrf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DummyFiveGNRFRequirerCharm(CharmBase):
def __init__(self, *args):
"""Init."""
super().__init__(*args)
self.nrf_requirer = NRFRequires(self, "fiveg-nrf")
self.nrf_requirer = NRFRequires(self, "fiveg_nrf")
self.framework.observe(self.nrf_requirer.on.nrf_available, self._on_nrf_available)
self.framework.observe(self.nrf_requirer.on.nrf_broken, self._on_nrf_broken)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class TestFiveGNRFProvider(unittest.TestCase):
def setUp(self):
self.relation_name = "fiveg-nrf"
self.relation_name = "fiveg_nrf"
self.remote_app_name = "dummy-nrf-requirer"
self.remote_unit_name = f"{self.remote_app_name}/0"
self.harness = testing.Harness(DummyFiveGNRFProviderCharm)
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_given_unit_is_leader_and_fiveg_nrf_relation_is_not_created_when_set_nrf
self.harness.charm.nrf_provider.set_nrf_information(
url="https://nrf.example.com", relation_id=relation_id_for_unexsistant_relation
)
self.assertEqual(str(e.value), "Relation fiveg-nrf not created yet.")
self.assertEqual(str(e.value), "Relation fiveg_nrf not created yet.")

def test_given_unit_is_leader_when_multiple_fiveg_nrf_relation_joined_then_data_in_application_databag( # noqa: E501
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class TestFiveGNRFRequirer(unittest.TestCase):
def setUp(self):
self.relation_name = "fiveg-nrf"
self.relation_name = "fiveg_nrf"
self.remote_app_name = "dummy-nrf-provider"
self.remote_unit_name = f"{self.remote_app_name}/0"
self.harness = testing.Harness(DummyFiveGNRFRequirerCharm)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def test_given_https_nrf_url_and_service_is_running_when_fiveg_nrf_relation_join
self.harness.set_can_connect(container="nrf", val=True)
self.harness.container_pebble_ready("nrf")
relation_id = self.harness.add_relation(
relation_name="fiveg-nrf",
relation_name="fiveg_nrf",
remote_app="nrf-requirer",
)
self.harness.add_relation_unit(relation_id=relation_id, remote_unit_name="nrf-requirer/0")
Expand Down Expand Up @@ -445,12 +445,12 @@ def test_service_starts_running_after_nrf_relation_joined_when_fiveg_pebble_read
self.harness.set_can_connect(container="nrf", val=False)

relation_1_id = self.harness.add_relation(
relation_name="fiveg-nrf",
relation_name="fiveg_nrf",
remote_app="nrf-requirer-1",
)

relation_2_id = self.harness.add_relation(
relation_name="fiveg-nrf",
relation_name="fiveg_nrf",
remote_app="nrf-requirer-2",
)
self.harness.add_relation_unit(
Expand Down

0 comments on commit 7ae436f

Please sign in to comment.