Skip to content

Commit

Permalink
Snap: use strict confinement (fix #48) (#50)
Browse files Browse the repository at this point in the history
* snapcraft.yaml: use strict confinement

* __main__.py: isort
  • Loading branch information
johnlettman authored Aug 25, 2024
1 parent 54a63d9 commit b8aaba4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 20 additions & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,34 @@ description: |
It uses automatic caching of Juju's status in json format to enable faster parsing.
license: MIT
grade: stable
confinement: classic
confinement: strict

architectures: [amd64, i386, arm64, armhf, ppc64el]

plugs:
juju-bin:
interface: content
content: juju-bin
target: $SNAP/usr/juju
default-provider: juju
dot-local-share-juju:
interface: personal-files
read:
- $HOME/.local/share/juju
- $HOME/.local/share/juju/ssh
- $HOME/.local/share/juju/lxd
write:
- $HOME/.local/share/juju/cookies

apps:
juju-jockey:
command: bin/juju-jockey
plugs:
- juju-bin
- dot-local-share-juju
- home
- ssh-keys
- network

parts:
juju-jockey:
Expand Down
5 changes: 5 additions & 0 deletions src/jockey/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
"""Jockey: a Juju query language to put all of your Juju objects at your fingertips."""
from argparse import ArgumentParser, FileType, Namespace
import os
import sys
from typing import Optional, Sequence

Expand All @@ -17,6 +18,10 @@
from jockey.status_keeper import cache_juju_status, read_local_juju_status_file, retrieve_juju_cache


if "SNAP" in os.environ:
os.environ["PATH"] += ":" + os.path.join(os.environ["SNAP"], "usr", "juju", "bin")


INFO_MESSAGE = f"""
+----+
|NOTE|
Expand Down

0 comments on commit b8aaba4

Please sign in to comment.