Skip to content

Commit dce2e01

Browse files
authored
Merge pull request #502 from SimonRichardson/fix-missing-exposed-endpoints
#502 The following fixes #501 where exposed-endpoints is missing from the API. We always set one, even if it's None.
2 parents 3100fe6 + 88e0fe2 commit dce2e01

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

juju/bundle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ class ExposeChange(ChangeInfo):
800800
def __init__(self, change_id, requires, params=None):
801801
super(ExposeChange, self).__init__(change_id, requires)
802802

803+
self.exposed_endpoints = None
803804
if isinstance(params, list):
804805
self.application = params[0]
805806
elif isinstance(params, dict):

tests/unit/test_bundle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ def test_list_params(self):
621621
change = ExposeChange(1, [], params=["application"])
622622
self.assertEqual({"change_id": 1,
623623
"requires": [],
624-
"application": "application"}, change.__dict__)
624+
"application": "application",
625+
"exposed_endpoints": None}, change.__dict__)
625626

626627
def test_dict_params(self):
627628
change = ExposeChange(1, [], params={"application": "application"})

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ deps =
3131
pytest-xdist
3232
Twine
3333
websockets
34+
kubernetes
3435
# use fork to pick up fix for https://github.com/aaugustin/websockets/pull/528
3536
git+https://github.com/johnsca/websockets@bug/client-redirects#egg=websockets ; python_version<'3.9'
3637

0 commit comments

Comments
 (0)