← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging ~cjwatson/launchpad-layers:turnip-remove-resource-handling into launchpad-layers:main.

Commit message:
turnip-base: Remove resource handling

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-layers/+git/launchpad-layers/+merge/445215

Now that `metadata.yaml` no longer declares a resource, it doesn't make sense to have code to handle it.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-layers:turnip-remove-resource-handling into launchpad-layers:main.
diff --git a/turnip-base/lib/charms/turnip/base.py b/turnip-base/lib/charms/turnip/base.py
index cbb736f..06e5272 100644
--- a/turnip-base/lib/charms/turnip/base.py
+++ b/turnip-base/lib/charms/turnip/base.py
@@ -223,12 +223,7 @@ def install_payload():
                 **swift_creds,
             )
         else:
-            resource_path = hookenv.resource_get("turnip")
-            if resource_path and os.path.getsize(resource_path):
-                with open(resource_path, "rb") as resource:
-                    host.write_file(archive_path, resource.read(), perms=0o644)
-            else:
-                raise PayloadError("No build available, so cannot deploy code")
+            raise PayloadError("No build available, so cannot deploy code")
 
         # Unpack source
         target_dir = os.path.join(payloads_dir(), desired_build_label)