diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8b170d7..b23f2ed 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -72,7 +72,6 @@ jobs: - name: external controller juju config run: | mkdir -p $HOME/.local/share/juju - # TODO: can we remove the base64 encoding? echo ${{ secrets.JUJU_CONTROLLERS_YAML }} | base64 -d > $HOME/.local/share/juju/controllers.yaml echo ${{ secrets.JUJU_ACCOUNTS_YAML }} | base64 -d > $HOME/.local/share/juju/accounts.yaml @@ -95,7 +94,7 @@ jobs: - name: install external controller required packages run: | - sudo snap install charmcraft --channel 2.x/stable --classic + sudo snap install charmcraft --channel 3.x/stable --classic sudo snap install juju --channel 3.4/stable --classic sudo --preserve-env=http_proxy,https_proxy,no_proxy pip3 install tox juju switch soleng-ci-ctrl-34 diff --git a/charmcraft.yaml b/charmcraft.yaml index 49d0f5d..81008cf 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -69,6 +69,8 @@ config: The charmed-openstack-exporter snap is by default installed from the latest/stable channel. This option allows the selection of a different channel. + In case the openStack-exporter resource has been attached, this option has no effect. + links: documentation: https://discourse.charmhub.io/t/openstack-exporter-docs-index/13876 @@ -89,3 +91,5 @@ resources: scraping. The snap resource on Charmhub is intended to be an empty file. The charm will ignore an empty file resource and normally install the snap from the snap store, but a custom snap can also be provided here if needed. + + This resource has top priority when the install hook is triggered. The snap_channel option will have no effect. diff --git a/src/charm.py b/src/charm.py index 776b9dc..4d1467d 100755 --- a/src/charm.py +++ b/src/charm.py @@ -95,11 +95,7 @@ def _write_cloud_config(self, data: dict[str, str]) -> None: OS_CLIENT_CONFIG.parent.mkdir(parents=True, exist_ok=True) OS_CLIENT_CONFIG_CACERT.write_text(self.config["ssl_ca"]) - auth_url = "{protocol}://{hostname}:{port}/v3".format( - protocol=data["service_protocol"], - hostname=data["service_hostname"], - port=data["service_port"], - ) + auth_url = f"{data['service_protocol']}://data['service_hostname']:{data['service_port']}/v3" contents = { "clouds": { CLOUD_NAME: { @@ -147,7 +143,7 @@ def get_resource(self) -> Optional[str]: logger.debug("cannot fetch charm resource") return None - if not os.path.getsize(snap_path) > 0: + if not os.path.getsize(snap_path): logger.debug("resource is an empty file") return None