diff --git a/LICENSE b/LICENSE index 4b8b005..21b28ad 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Canonical Ltd. + Copyright 2026 Canonical Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/charmcraft.yaml b/charmcraft.yaml index 630b223..329371a 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. name: git-ubuntu diff --git a/pyproject.toml b/pyproject.toml index f91721b..77f84b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. [project] diff --git a/src/charm.py b/src/charm.py index 11935ba..db14bfb 100755 --- a/src/charm.py +++ b/src/charm.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more at: https://juju.is/docs/sdk @@ -456,7 +456,10 @@ def _on_config_changed(self, _: ops.ConfigChangedEvent) -> None: def _on_leader_elected(self, _: ops.LeaderElectedEvent) -> None: """Refresh services and update peer data when the unit is elected as leader.""" - if not self._set_peer_primary_node_address(): + if self._set_peer_primary_node_address(): + self._refresh_importer_node() + self._start_services() + else: self.unit.status = ops.BlockedStatus( "Failed to update primary node IP in peer relation." ) diff --git a/src/environment.py b/src/environment.py index 1af9495..3522f6e 100644 --- a/src/environment.py +++ b/src/environment.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Environment information extraction.""" diff --git a/src/git_ubuntu.py b/src/git_ubuntu.py index cc83b8f..18043f3 100644 --- a/src/git_ubuntu.py +++ b/src/git_ubuntu.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Git Ubuntu service runner and configurator.""" diff --git a/src/importer_node.py b/src/importer_node.py index 4e9a815..2f96dd1 100644 --- a/src/importer_node.py +++ b/src/importer_node.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Manager of files and git-ubuntu instances on the local system.""" diff --git a/src/launchpad.py b/src/launchpad.py index e695a2c..4eb8f57 100644 --- a/src/launchpad.py +++ b/src/launchpad.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Launchpad interaction and tools.""" diff --git a/src/package_installation.py b/src/package_installation.py index 1a67e71..0bffd9b 100644 --- a/src/package_installation.py +++ b/src/package_installation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Snap and Apt package installation and update functions.""" diff --git a/src/service_management.py b/src/service_management.py index 8bd43f9..5123dfb 100644 --- a/src/service_management.py +++ b/src/service_management.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Systemd service management functions.""" diff --git a/src/user_management.py b/src/user_management.py index dbe03dd..b7b6aea 100644 --- a/src/user_management.py +++ b/src/user_management.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Machine user management functions.""" diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 9ef580e..31d4fa4 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index c76b988..4d5808c 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index bfa35e2..2724f4d 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index d56008c..7097b52 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_environment.py b/tests/unit/test_environment.py index 1deece7..e0b5d29 100644 --- a/tests/unit/test_environment.py +++ b/tests/unit/test_environment.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_git_ubuntu.py b/tests/unit/test_git_ubuntu.py index 78992e8..ff5b10f 100644 --- a/tests/unit/test_git_ubuntu.py +++ b/tests/unit/test_git_ubuntu.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_importer_node.py b/tests/unit/test_importer_node.py index f1c2bc5..5a8d9b3 100644 --- a/tests/unit/test_importer_node.py +++ b/tests/unit/test_importer_node.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_launchpad.py b/tests/unit/test_launchpad.py index e63394a..c359674 100644 --- a/tests/unit/test_launchpad.py +++ b/tests/unit/test_launchpad.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_package_installation.py b/tests/unit/test_package_installation.py index dedfb4c..a4e7ced 100644 --- a/tests/unit/test_package_installation.py +++ b/tests/unit/test_package_installation.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tests/unit/test_user_management.py b/tests/unit/test_user_management.py index dd243ec..fad91ad 100644 --- a/tests/unit/test_user_management.py +++ b/tests/unit/test_user_management.py @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing diff --git a/tox.ini b/tox.ini index 701d085..9a61ee7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Copyright 2025 Canonical Ltd. +# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. [tox]