Skip to content

Commit 0e6444e

Browse files
Use Id from charmstore entity
When supporting older facades we need to get and use the charm Id from the entity get. As a driveby I've sorted out the lint issues
1 parent 1a2c2a0 commit 0e6444e

6 files changed

Lines changed: 4 additions & 6 deletions

File tree

examples/deploy_bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def main():
1616
await controller.connect()
1717

1818
bundles = [('cs:~juju-qa/bundle/basic-0', 'beta'), ('juju-qa-bundle-test', None)]
19-
for i in range(len(bundles)):
19+
for i in range(len(bundles)):
2020
deployment = bundles[i]
2121
model = await controller.add_model('model{}'.format(i))
2222

juju/bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from .errors import JujuError
1717
from .origin import Channel
1818
from .url import Schema, URL
19-
from .version import LTS_RELEASES
2019

2120
log = logging.getLogger(__name__)
2221

@@ -260,6 +259,7 @@ async def _resolve_charms(self):
260259
spec['charm'] = str(charm_url)
261260
else:
262261
results = await self.model.charmstore.entity(str(charm_url))
262+
charm_url = results.get('Id', charm_url)
263263
charm_origin = client.CharmOrigin(source="charm-store",
264264
risk=risk,
265265
track=track)

juju/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,6 @@ async def deploy(
14321432
entity_url = str(entity_url)
14331433
if is_local_charm(entity_url) and not entity_url.startswith("local:"):
14341434
entity_url = "local:{}".format(entity_url)
1435-
print("!!!", entity_url)
14361435
url = URL.parse(str(entity_url))
14371436
architecture = await self._resolve_architecture(url)
14381437

juju/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
LTS_RELEASES = ["focal", "bionic", "xenial", "trusty", "precise"]
33

4-
DEFAULT_ARCHITECTURE = 'amd64'
4+
DEFAULT_ARCHITECTURE = 'amd64'

tests/integration/test_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def test_deploy_charmhub_charm(event_loop):
110110
app = await model.deploy('hello-juju')
111111
await model.block_until(lambda: (len(app.units) > 0 and
112112
app.units[0].machine))
113-
assert 'hello-juju' in app.data['charm-url']
113+
assert 'hello-juju' in app.data['charm-url']
114114

115115

116116
@base.bootstrapped

tests/unit/test_bundle.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ async def test_run_with_charmstore_charm(self, event_loop):
199199
devices="devices",
200200
num_units="num_units")
201201

202-
203202
@pytest.mark.asyncio
204203
async def test_run_with_charmhub_charm(self, event_loop):
205204
change = AddApplicationChange(1, [], params={"charm": "charm",

0 commit comments

Comments
 (0)