Merge ~barryprice/junk/+git/snap-juju-parse-status:master into ~barryprice/junk/+git/snap-juju-parse-status:main

Proposed by Barry Price
Status: Needs review
Proposed branch: ~barryprice/junk/+git/snap-juju-parse-status:master
Merge into: ~barryprice/junk/+git/snap-juju-parse-status:main
Diff against target: 128 lines (+98/-0)
5 files modified
.gitignore (+1/-0)
patches/debuglogs.patch (+13/-0)
patches/status.patch (+11/-0)
setup/setup.py (+18/-0)
snap/snapcraft.yaml (+55/-0)
Reviewer Review Type Date Requested Status
Barry Price Pending
Review via email: mp+397204@code.launchpad.net

Commit message

Hacky classic snap - this will pull & patch juju-parse-status from the latest Mojo release and make it work as a standalone utility

To post a comment you must log in.

Unmerged commits

1af1f43... by Barry Price

Hacky classic snap - this will pull & patch juju-parse-status from the latest Mojo release and make it work as a standalone utility

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..d294450
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1 @@
7+*.snap
8diff --git a/patches/debuglogs.patch b/patches/debuglogs.patch
9new file mode 100644
10index 0000000..4600a2b
11--- /dev/null
12+++ b/patches/debuglogs.patch
13@@ -0,0 +1,13 @@
14+--- juju/debuglogs.py 2021-01-30 16:07:22.268049483 +0700
15++++ juju/debuglogs.py 2021-01-30 16:07:28.016097437 +0700
16+@@ -6,8 +6,8 @@
17+
18+ from .status import Status
19+
20+-from ..exceptions import ConfigNotFoundException
21+-from ..shutil_which import get_command
22++from exceptions import ConfigNotFoundException
23++from shutil_which import get_command
24+
25+ DEFAULT_DEBUG_LOG_CONFIG = {}
26+
27diff --git a/patches/status.patch b/patches/status.patch
28new file mode 100644
29index 0000000..c223741
30--- /dev/null
31+++ b/patches/status.patch
32@@ -0,0 +1,11 @@
33+--- juju/status.py 2021-01-30 16:07:31.652127771 +0700
34++++ juju/status.py 2021-01-30 16:07:36.456167850 +0700
35+@@ -9,7 +9,7 @@
36+ from collections import Counter
37+
38+ from .wait import wait, JujuWaitException
39+-from ..shutil_which import get_command
40++from shutil_which import get_command
41+
42+ # We can't use the implementation in .utils due to a circular import
43+ juju_path, _ = get_command("juju")
44diff --git a/setup/setup.py b/setup/setup.py
45new file mode 100644
46index 0000000..c5b57c8
47--- /dev/null
48+++ b/setup/setup.py
49@@ -0,0 +1,18 @@
50+try:
51+ from setuptools import setup, find_packages
52+except ImportError:
53+ from distutils.core import setup, find_packages
54+
55+
56+setup(
57+ name='juju-parse-status',
58+ version='0.1',
59+ install_requires=["PyYAML"],
60+ py_modules=['exceptions', 'shutil_which'],
61+ packages=find_packages(),
62+ entry_points={
63+ "console_scripts": [
64+ "juju-parse-status = juju.parse_status:main",
65+ ]
66+ },
67+)
68diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
69new file mode 100644
70index 0000000..c511897
71--- /dev/null
72+++ b/snap/snapcraft.yaml
73@@ -0,0 +1,55 @@
74+name: juju-parse-status
75+title: Juju Parse Status
76+summary: Juju command to extract information from Juju status
77+description: >
78+ Juju command to extract information from Juju status
79+
80+version: "0.1"
81+
82+base: core20
83+confinement: classic
84+grade: stable
85+
86+apps:
87+ juju-parse-status:
88+ command: bin/juju-parse-status
89+ environment:
90+ PYTHONPATH: $SNAP/lib/python3.8/site-packages/
91+parts:
92+ juju-parse-status:
93+ plugin: python
94+ python-packages:
95+ - wheel
96+ override-pull: |
97+ set -eux
98+ cp $SNAPCRAFT_STAGE/mojo/exceptions.py .
99+ cp $SNAPCRAFT_STAGE/mojo/shutil_which.py .
100+ cp -r $SNAPCRAFT_STAGE/mojo/juju .
101+ cp $SNAPCRAFT_STAGE/setup.py .
102+ patch -p0 < $SNAPCRAFT_STAGE/debuglogs.patch
103+ patch -p0 < $SNAPCRAFT_STAGE/status.patch
104+ after:
105+ - mojo
106+ mojo:
107+ plugin: dump
108+ source: lp:mojo
109+ stage:
110+ - -setup.py
111+ prime:
112+ - -*
113+ after:
114+ - patches
115+ patches:
116+ source: ./patches
117+ source-type: local
118+ plugin: dump
119+ prime:
120+ - -*
121+ after:
122+ - setup
123+ setup:
124+ source: ./setup
125+ source-type: local
126+ plugin: dump
127+ prime:
128+ - setup.py

Subscribers

People subscribed via source and target branches

to all changes: