Skip to content

Commit b90f16b

Browse files
authored
Merge pull request #786 from cderici/no-charmstore-on-libjuju
#786 #### Description This is the final major step in removing the CharmStore support from juju. Being part of the [Disallow charmstore charms in 3.1+](https://warthogs.atlassian.net/browse/JUJU-2201) epic, this is related to PRs such as juju/juju#15013, juju/juju#15045, juju/juju#14996, etc. #### QA Steps As there's no more charmstore charm support in Juju anyways, this PR doesn't really change any behavior. However, all the rest of the functionality should be working fine, so current tests should pass without any issues. #### Notes & Discussion This also removes references for the `theblues` library as we no longer need it to access the charmstore.
2 parents 5c72197 + b03c1df commit b90f16b

35 files changed

Lines changed: 114 additions & 630 deletions

examples/add_machine.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,28 @@ async def main():
3030
'mem': 256 * MB,
3131
},
3232
disks=[{
33-
'pool': 'rootfs',
3433
'size': 10 * GB,
3534
'count': 1,
3635
}],
37-
series='xenial',
36+
series='jammy',
3837
)
38+
3939
# add a lxd container to machine2
4040
machine3 = await model.add_machine(
4141
'lxd:{}'.format(machine2.id),
42-
series='xenial'
42+
series='jammy'
4343
)
4444

4545
# deploy charm to the lxd container
4646
application = await model.deploy(
47-
'cs:ubuntu-10',
47+
'ch:ubuntu',
4848
application_name='ubuntu',
49-
series='xenial',
49+
series='jammy',
5050
channel='stable',
5151
to=machine3.id
5252
)
5353

54-
await model.block_until(
55-
lambda: all(unit.workload_status == 'active'
56-
for unit in application.units))
54+
await model.wait_for_idle(status='active')
5755

5856
await application.remove()
5957

examples/add_model.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ async def main():
2929

3030
print('Deploying ubuntu')
3131
application = await model.deploy(
32-
'cs:ubuntu-10',
32+
'ch:ubuntu',
3333
application_name='ubuntu',
34-
series='trusty',
34+
series='jammy',
3535
channel='stable',
3636
)
3737

3838
print('Waiting for active')
3939
await asyncio.sleep(10)
40-
await model.block_until(
41-
lambda: all(unit.workload_status == 'active'
42-
for unit in application.units))
40+
await model.wait_for_idle(status='active')
4341

4442
print("Verifying that we can ssh into the created model")
4543
ret = await utils.execute_process(

examples/config.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,38 @@ async def main():
2222
await model.connect()
2323

2424
ubuntu_app = await model.deploy(
25-
'cs:mysql',
25+
'mysql',
2626
application_name='mysql',
27-
series='trusty',
28-
channel='stable',
27+
series='jammy',
28+
channel='edge',
2929
config={
30-
'tuning-level': 'safest',
30+
'cluster-name': 'foo',
3131
},
3232
constraints={
3333
'mem': 256 * MB,
3434
},
3535
)
36+
await model.wait_for_idle(status='active')
3637

3738
# update and check app config
38-
await ubuntu_app.set_config({'tuning-level': 'fast'})
39+
await ubuntu_app.set_config({'cluster-name': 'bar'})
3940
config = await ubuntu_app.get_config()
40-
assert (config['tuning-level']['value'] == 'fast')
41+
assert (config['cluster-name']['value'] == 'bar')
4142

4243
# update and check app constraints
4344
await ubuntu_app.set_constraints({'mem': 512 * MB})
4445
constraints = await ubuntu_app.get_constraints()
4546
assert (constraints['mem'] == 512 * MB)
4647

48+
print('Removing mysql')
49+
await ubuntu_app.remove()
50+
51+
print('Disconnecting from model')
4752
await model.disconnect()
4853

4954

5055
if __name__ == '__main__':
51-
logging.basicConfig(level=logging.DEBUG)
56+
# logging.basicConfig(level=logging.DEBUG)
5257
ws_logger = logging.getLogger('websockets.protocol')
5358
ws_logger.setLevel(logging.INFO)
5459
jasyncio.run(main())

examples/credential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def main(cloud_name, credential_name):
2222

2323
# verify we can deploy
2424
print('Deploying ubuntu')
25-
app = await model.deploy('cs:ubuntu-10')
25+
app = await model.deploy('ch:ubuntu')
2626

2727
print('Waiting for active')
2828
await model.block_until(

examples/crossmodel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ async def main():
2929

3030
print('Deploying mysql')
3131
application = await offering_model.deploy(
32-
'cs:mysql',
32+
'ch:mysql',
3333
application_name='mysql',
34-
series='trusty',
35-
channel='stable',
34+
series='jammy',
35+
channel='edge',
3636
)
3737

3838
print('Waiting for active')

examples/crossmodel_bundle.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ async def main():
3131
consuming_model = await controller.add_model('test-cmr-2')
3232

3333
print('Deploying mysql')
34-
application_1 = await offering_model.deploy(
35-
'cs:mysql-58',
34+
await offering_model.deploy(
35+
'ch:mysql',
3636
application_name='mysql',
37-
series='xenial',
38-
channel='stable',
37+
series='jammy',
38+
channel='edge',
3939
)
4040

4141
print('Waiting for active')
42-
await offering_model.block_until(
43-
lambda: all(unit.workload_status == 'active'
44-
for unit in application_1.units))
42+
await offering_model.wait_for_idle(status='active')
4543

4644
print('Adding offer')
4745
await offering_model.create_offer("mysql:db")

examples/crossmodel_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def main():
3737

3838
print('Deploying mysql')
3939
application = await offering_model.deploy(
40-
'cs:mysql',
40+
'ch:mysql',
4141
application_name='mysql',
4242
series='trusty',
4343
channel='stable',

examples/crossmodel_relation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ async def main():
3131
consuming_model = await controller.add_model('test-cmr-2')
3232

3333
print('Deploying mysql')
34-
application_1 = await offering_model.deploy(
35-
'cs:mysql-58',
34+
await offering_model.deploy(
35+
'ch:mysql',
3636
application_name='mysql',
37-
series='xenial',
38-
channel='stable',
37+
series='jammy',
38+
channel='edge',
3939
)
4040

4141
print('Waiting for active')
42-
await offering_model.block_until(
43-
lambda: all(unit.workload_status == 'active'
44-
for unit in application_1.units))
42+
await offering_model.wait_for_idle(status='active')
4543

4644
print('Adding offer')
4745
await offering_model.create_offer("mysql:db")
@@ -53,9 +51,11 @@ async def main():
5351

5452
print('Show offers', ', '.join("%s: %s" % item for offer in offers.results for item in vars(offer).items()))
5553

54+
# TODO (cderici): wordpress charm is somewhat problematic in 3.0,
55+
# this example needs to be revisited.
5656
print('Deploying wordpress')
5757
application_2 = await consuming_model.deploy(
58-
'cs:trusty/wordpress-5',
58+
'ch:trusty/wordpress',
5959
application_name='wordpress',
6060
series='xenial',
6161
channel='stable',

examples/debug-log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def main():
2020
)
2121

2222
application = await model.deploy(
23-
'cs:ubuntu-10',
23+
'ch:ubuntu',
2424
application_name='ubuntu',
2525
series='trusty',
2626
channel='stable',

examples/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def main():
1919
try:
2020
print('Deploying ubuntu')
2121
application = await model.deploy(
22-
'cs:ubuntu-10',
22+
'ch:ubuntu',
2323
application_name='ubuntu',
2424
series='trusty',
2525
channel='stable',

0 commit comments

Comments
 (0)