Please support custom stores

Bug #1650210 reported by Michael Vogt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Wishlist
Celso Providelo

Bug Description

I had to validate a snap from a custom store today. When doing this, I got:

$ snapcraft validate custom custom-kernel=3
Getting details for custom-kernel
Snap 'custom-kernel' was not found in the 'stable' channel.

because snapcraft is only looking into the default store.

As a quick hack I added:
diff --git a/snapcraft/storeapi/__init__.py b/snapcraft/storeapi/__init__.py
index c57626e..5a329ba 100644
--- a/snapcraft/storeapi/__init__.py
+++ b/snapcraft/storeapi/__init__.py
@@ -361,6 +361,9 @@ class SnapIndexClient(Client):
         }
         if arch:
             headers['X-Ubuntu-Architecture'] = arch
+ if os.getenv("SNAPCRAFT_UBUNTU_STORE") != "":
+ headers['X-Ubuntu-Store'] = os.getenv("SNAPCRAFT_UBUNTU_STORE")
+

         params = {
             'channel': channel,

and with that I was able to validate my snap:
$ SNAPCRAFT_UBUNTU_STORE=custom-store-name snapcraft validate custom custom-kernel=3

Celso Providelo (cprov)
Changed in snapcraft:
status: New → In Progress
assignee: nobody → Celso Providelo (cprov)
Revision history for this message
Celso Providelo (cprov) wrote :
Changed in snapcraft:
status: In Progress → Fix Committed
importance: Undecided → Wishlist
milestone: none → 2.24
Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.