Skip to content

Commit

Permalink
update snapd check
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Stokes <[email protected]>
  • Loading branch information
adam-stokes committed Nov 20, 2020
1 parent e0b5c8b commit 989198f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jobs/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ async def model(request, event_loop, tools):
await upgrade_snaps(model, upgrade_snap_channel, tools)
if request.config.getoption("--snapd-upgrade"):
snapd_channel = request.config.getoption("--snapd-channel")
cmd = f"sudo snap refresh core --{snapd_channel}"
cloudinit_userdata = {"postruncmd": [cmd]}
cloudinit_userdata_str = yaml.dump(cloudinit_userdata)
await model.set_config({"cloudinit-userdata": cloudinit_userdata_str})
await model.deploy("cs:~containers/charmed-kubernetes")
await log_snap_versions(model, prefix="Before")
await tools.juju_wait()
for unit in model.units.values():
if unit.dead:
continue
await unit.run(f"sudo snap refresh core --{snapd_channel}")
await tools.juju_wait()
await log_snap_versions(model, prefix="After")
yield model
await model.disconnect()
Expand Down

0 comments on commit 989198f

Please sign in to comment.