Skip to content

Commit 90c7690

Browse files
Merge pull request #774 from juanmanuel-tirado/JUJU-2175_remove_2.9_support
[JUJU-2175] Remove juju 2.9 support on 3.1.0
2 parents fd89d1a + c547141 commit 90c7690

95 files changed

Lines changed: 400 additions & 1475170 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Testing
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Linter
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python:
12+
- "3.8"
13+
- "3.9"
14+
- "3.10"
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v3
18+
- name: Setup Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python }}
22+
- name: Install dependencies
23+
run: pip install tox
24+
- name: Run linter
25+
run: tox -e lint
26+
27+
unit-tests:
28+
needs: lint
29+
name: Unit tests
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
python:
34+
- "3.8"
35+
- "3.9"
36+
- "3.10"
37+
steps:
38+
- name: Check out code
39+
uses: actions/checkout@v3
40+
- name: Setup Python
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python }}
44+
- name: Install dependencies
45+
run: pip install tox
46+
- name: Run unit tests
47+
run: tox -e py3
48+
49+
integration:
50+
name: Integration
51+
needs: [lint, unit-tests]
52+
timeout-minutes: 120
53+
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
python:
57+
- "3.8"
58+
- "3.9"
59+
- "3.10"
60+
steps:
61+
- name: Check out code
62+
uses: actions/checkout@v3
63+
- name: Setup operator environment
64+
uses: charmed-kubernetes/actions-operator@main
65+
with:
66+
provider: lxd
67+
juju-channel: 3.0/stable
68+
- name: Set proxy in controller
69+
run: |
70+
set -euxo pipefail
71+
# build a squid config file
72+
CONTROLLER_IP=$(juju list-controllers --format yaml | yq '.controllers[.current-controller].recent-server' | awk -F '[:]' '{print $1}');
73+
echo "Controller IP is: $CONTROLLER_IP"
74+
PROXY=$CONTROLLER_IP:3128
75+
echo "Proxy address is: $PROXY"
76+
echo "acl all src all" > squid.conf
77+
echo "http_access allow all" >> squid.conf
78+
echo "http_port $PROXY" >> squid.conf
79+
cat squid.conf
80+
# copy to the controller and reconfigure it
81+
juju status -m controller
82+
juju switch controller
83+
juju ssh 0 "sudo apt-get install squid -y"
84+
juju scp squid.conf 0:/tmp/squid.conf
85+
juju ssh 0 "sudo mv /tmp/squid.conf /etc/squid/squid.conf"
86+
juju ssh 0 "sudo squid -k reconfigure"
87+
# Test curl after waiting
88+
sleep 10
89+
echo "Test proxy access"
90+
curl -s -o /dev/null -w "%{http_code}" --proxy http://$PROXY https://charmhub.io
91+
# set model defaults
92+
juju model-defaults apt-http-proxy=$PROXY apt-https-proxy=$PROXY juju-http-proxy=$PROXY juju-https-proxy=$PROXY snap-http-proxy=$PROXY snap-https-proxy=$PROXY
93+
juju model-defaults
94+
- name: Setup Python
95+
uses: actions/setup-python@v4
96+
with:
97+
python-version: ${{ matrix.python }}
98+
- name: Install dependencies
99+
run: pip install tox
100+
- name: Run integration
101+
# Force one single concurrent test
102+
run: tox -e integration -- -n 1

.github/workflows/tox.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.4
1+
3.1.0-b1

examples/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ async def main():
2424
'aws-tim',
2525
)
2626
await model.deploy(
27-
'cs:ubuntu-0',
27+
'ubuntu',
2828
application_name='ubuntu',
29-
series='trusty',
29+
series='focal',
3030
channel='stable',
3131
)
3232
await model.disconnect()

examples/fullstatus.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ async def status():
1515

1616
return status
1717

18-
1918
if __name__ == '__main__':
2019
jasyncio.run(status())

juju/client/_client.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@
44
from juju.client._definitions import *
55

66

7-
from juju.client import _client7, _client1, _client3, _client2, _client14, _client4, _client6, _client5, _client11, _client9, _client18, _client8, _client15
7+
from juju.client import _client7, _client1, _client3, _client4, _client2, _client15, _client6, _client5, _client11, _client9, _client18
88

99

1010
CLIENTS = {
1111
"7": _client7,
1212
"1": _client1,
1313
"3": _client3,
14-
"2": _client2,
15-
"14": _client14,
1614
"4": _client4,
15+
"2": _client2,
16+
"15": _client15,
1717
"6": _client6,
1818
"5": _client5,
1919
"11": _client11,
2020
"9": _client9,
21-
"18": _client18,
22-
"8": _client8,
23-
"15": _client15
21+
"18": _client18
2422
}
2523

2624

@@ -154,10 +152,6 @@ class CAASApplicationProvisionerFacade(TypeFactory):
154152
pass
155153

156154

157-
class CAASFirewallerEmbeddedFacade(TypeFactory):
158-
pass
159-
160-
161155
class CAASFirewallerFacade(TypeFactory):
162156
pass
163157

@@ -194,10 +188,6 @@ class CharmDownloaderFacade(TypeFactory):
194188
pass
195189

196190

197-
class CharmHubFacade(TypeFactory):
198-
pass
199-
200-
201191
class CharmRevisionUpdaterFacade(TypeFactory):
202192
pass
203193

@@ -286,10 +276,6 @@ class HostKeyReporterFacade(TypeFactory):
286276
pass
287277

288278

289-
class ImageManagerFacade(TypeFactory):
290-
pass
291-
292-
293279
class ImageMetadataFacade(TypeFactory):
294280
pass
295281

@@ -462,10 +448,6 @@ class ResourcesHookContextFacade(TypeFactory):
462448
pass
463449

464450

465-
class ResumerFacade(TypeFactory):
466-
pass
467-
468-
469451
class RetryStrategyFacade(TypeFactory):
470452
pass
471453

@@ -482,10 +464,6 @@ class SecretsManagerFacade(TypeFactory):
482464
pass
483465

484466

485-
class SecretsRotationWatcherFacade(TypeFactory):
486-
pass
487-
488-
489467
class SecretsTriggerWatcherFacade(TypeFactory):
490468
pass
491469

0 commit comments

Comments
 (0)