Merge ~cjwatson/launchpad-layers:turnip-remove-resource-handling into launchpad-layers:main

Proposed by Colin Watson
Status: Merged
Merged at revision: 6fcdb345faecb9940ec2fe541e255c546c950ed0
Proposed branch: ~cjwatson/launchpad-layers:turnip-remove-resource-handling
Merge into: launchpad-layers:main
Diff against target: 18 lines (+1/-6)
1 file modified
turnip-base/lib/charms/turnip/base.py (+1/-6)
Reviewer Review Type Date Requested Status
Clinton Fung Approve
Jürgen Gmach Approve
Review via email: mp+445215@code.launchpad.net

Commit message

turnip-base: Remove resource handling

Description of the change

Now that `metadata.yaml` no longer declares a resource, it doesn't make sense to have code to handle it.

To post a comment you must log in.
Revision history for this message
Clinton Fung (clinton-fung) :
review: Needs Information
Revision history for this message
Colin Watson (cjwatson) :
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve
Revision history for this message
Clinton Fung (clinton-fung) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/turnip-base/lib/charms/turnip/base.py b/turnip-base/lib/charms/turnip/base.py
2index cbb736f..06e5272 100644
3--- a/turnip-base/lib/charms/turnip/base.py
4+++ b/turnip-base/lib/charms/turnip/base.py
5@@ -223,12 +223,7 @@ def install_payload():
6 **swift_creds,
7 )
8 else:
9- resource_path = hookenv.resource_get("turnip")
10- if resource_path and os.path.getsize(resource_path):
11- with open(resource_path, "rb") as resource:
12- host.write_file(archive_path, resource.read(), perms=0o644)
13- else:
14- raise PayloadError("No build available, so cannot deploy code")
15+ raise PayloadError("No build available, so cannot deploy code")
16
17 # Unpack source
18 target_dir = os.path.join(payloads_dir(), desired_build_label)

Subscribers

People subscribed via source and target branches