Skip to content

Commit efd8c35

Browse files
committed
Address flake8 lint errors
1 parent 4f762a8 commit efd8c35

4 files changed

Lines changed: 23 additions & 27 deletions

File tree

examples/expose-application.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from juju.model import Model
1313
from juju.application import ExposedEndpoint
1414

15-
import logging
1615

1716
async def main():
1817
model = Model()

juju/application.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,19 +341,16 @@ async def unexpose(self, exposed_endpoints=None):
341341
if facade_version < 13:
342342
raise JujuError("controller does not support granular expose parameters; applying this change would unexpose the application")
343343

344-
log.debug("Unexposing endpoints %s of %s",
345-
",".join(exposed_endpoints), self.name)
344+
log.debug("Unexposing endpoints %s of %s", ",".join(exposed_endpoints), self.name)
346345
return await app_facade.Unexpose(application=self.name,
347346
exposed_endpoints=exposed_endpoints)
348347

349348
# Just expose the entire application
350349
log.debug("Unexposing %s", self.name)
351350
return await app_facade.Unexpose(application=self.name)
352351

353-
354352
async def get_config(self):
355353
"""Return the configuration settings dict for this application.
356-
357354
"""
358355
app_facade = self._facade()
359356

tests/unit/test_application.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,28 @@ async def test_expose_endpoints_on_older_controller(self, mock_conn):
9494
# Case 1: exposed_endpoints includes an entry with a space list.
9595
with self.assertRaises(JujuError):
9696
await app.expose(exposed_endpoints={
97-
"": ExposedEndpoint(to_spaces=["alpha"]),
97+
"": ExposedEndpoint(to_spaces=["alpha"]),
9898
})
9999

100100
# Case 2: exposed_endpoints only includes the wildcard endpoints key
101101
# with a non-wildcard CIDR.
102102
with self.assertRaises(JujuError):
103103
await app.expose(exposed_endpoints={
104-
"": ExposedEndpoint(to_cidrs=["0.0.0.0/0", "10.0.0.0/24"]),
104+
"": ExposedEndpoint(to_cidrs=["0.0.0.0/0", "10.0.0.0/24"]),
105105
})
106106

107107
# Case 3: exposed_endpoints has a single entry for the
108108
# non-wildcard endpoint.
109109
with self.assertRaises(JujuError):
110110
await app.expose(exposed_endpoints={
111-
"": ExposedEndpoint(to_cidrs=["0.0.0.0/0", "10.0.0.0/24"]),
111+
"": ExposedEndpoint(to_cidrs=["0.0.0.0/0", "10.0.0.0/24"]),
112112
})
113113

114114
# Case 4: exposed_endpoints has multiple keys.
115115
with self.assertRaises(JujuError):
116116
await app.expose(exposed_endpoints={
117-
"foo": ExposedEndpoint(to_cidrs=["0.0.0.0/0"]),
118-
"bar": ExposedEndpoint(to_spaces=["alpha"]),
117+
"foo": ExposedEndpoint(to_cidrs=["0.0.0.0/0"]),
118+
"bar": ExposedEndpoint(to_spaces=["alpha"]),
119119
})
120120

121121
# Check that we call the facade with the right arity.
@@ -139,7 +139,7 @@ async def test_unexpose_endpoints_on_older_controller(self, mock_conn):
139139
# If we try to unexpose individual endpoints on an older controller
140140
# (app facade < 13) we should get an error back.
141141
with self.assertRaises(JujuError):
142-
await app.unexpose(exposed_endpoints=["outer","inner"])
142+
await app.unexpose(exposed_endpoints=["outer", "inner"])
143143

144144
# Check that we call the facade with the right arity.
145145
await app.unexpose()

tests/unit/test_bundle.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -634,14 +634,14 @@ def test_dict_params_with_exposed_endpoints_data(self):
634634
"requires": [],
635635
"application": "application",
636636
"exposed_endpoints": {
637-
"": {
638-
"to-spaces": ["alpha"],
639-
"to-cidrs": ["10.0.0.0/24"]
640-
},
641-
"foo": {
642-
"to-spaces": ["alien"],
643-
"to-cidrs": ["0.0.0.0/0", "::/0"]
644-
}
637+
"": {
638+
"to-spaces": ["alpha"],
639+
"to-cidrs": ["10.0.0.0/24"]
640+
},
641+
"foo": {
642+
"to-spaces": ["alien"],
643+
"to-cidrs": ["0.0.0.0/0", "::/0"]
644+
}
645645
}}, change.__dict__)
646646

647647

@@ -678,14 +678,14 @@ async def test_run(self, event_loop):
678678

679679
model.applications["application1"].expose.assert_called_once()
680680
model.applications["application1"].expose.assert_called_with({
681-
"": {
682-
"to-spaces": ["alpha"],
683-
"to-cidrs": ["10.0.0.0/24"]
684-
},
685-
"foo": {
686-
"to-spaces": ["alien"],
687-
"to-cidrs": ["0.0.0.0/0", "::/0"]
688-
}
681+
"": {
682+
"to-spaces": ["alpha"],
683+
"to-cidrs": ["10.0.0.0/24"]
684+
},
685+
"foo": {
686+
"to-spaces": ["alien"],
687+
"to-cidrs": ["0.0.0.0/0", "::/0"]
688+
}
689689
})
690690

691691

0 commit comments

Comments
 (0)