Skip to content

Commit df07820

Browse files
author
Juan Tirado
committed
Remove some comments.
1 parent 33de90a commit df07820

3 files changed

Lines changed: 2 additions & 33 deletions

File tree

juju/client/connection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,9 +836,6 @@ async def _connect_with_login(self, endpoints):
836836
macaroonJSON = result.get('discharge-required')
837837
if macaroonJSON is None:
838838
self.info = result
839-
# Whenever a connection is established, set
840-
# the new_client flag in the Client module
841-
# client.set_new_client(self.info['server-version'])
842839
success = True
843840
return result
844841
macaroon = bakery.Macaroon.from_dict(macaroonJSON)

juju/jasyncio.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,6 @@
3434
get_event_loop_policy, CancelledError, get_running_loop, \
3535
create_task # noqa
3636

37-
# No more workaround for these imports
38-
# try:
39-
# from asyncio import get_running_loop
40-
# except ImportError:
41-
# def get_running_loop():
42-
# loop = asyncio.get_event_loop()
43-
# if not loop.is_running():
44-
# raise RuntimeError("no running event loop")
45-
# return loop
46-
47-
# try:
48-
# from asyncio import create_task
49-
# except ImportError:
50-
# def create_task(coro):
51-
# return asyncio.ensure_future(coro)
52-
5337

5438
def create_task_with_handler(coro, task_name, logger=ROOT_LOGGER):
5539
"""Wrapper around "asyncio.create_task" to make sure the task

juju/model.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,10 +1747,6 @@ async def deploy(
17471747

17481748
charm_series = series
17491749

1750-
# if self.connection().is_using_old_client and charm_series is None:
1751-
# # Also try
1752-
# charm_series = res.origin.series
1753-
17541750
if res.is_bundle:
17551751
handler = BundleHandler(self, trusted=trust, forced=force)
17561752
await handler.fetch_plan(url, res.origin, overlays=overlays)
@@ -1809,11 +1805,7 @@ async def deploy(
18091805

18101806
if not application_name:
18111807
application_name = metadata['name']
1812-
# if self.connection().is_using_old_client and not charm_series:
1813-
# raise JujuError(
1814-
# "Couldn't determine series for charm at {}. "
1815-
# "Pass a 'series' kwarg to Model.deploy().".format(
1816-
# charm_dir))
1808+
18171809
identifier = await self.add_local_charm_dir(charm_dir,
18181810
charm_series)
18191811
resources = await self.add_local_resources(application_name,
@@ -1888,7 +1880,6 @@ async def _resolve_charm(self, url, origin):
18881880
'track': origin.track,
18891881
'risk': origin.risk,
18901882
}
1891-
# if not self.connection().is_using_old_client:
18921883
resolve_origin['base'] = origin.base
18931884

18941885
resp = await charms_facade.ResolveCharms(resolve=[{
@@ -2185,8 +2176,6 @@ async def get_constraints(self):
21852176
"""
21862177
constraints = {}
21872178
facade_cls = client.ModelConfigFacade
2188-
# if self.connection().is_using_old_client:
2189-
# facade_cls = client.ClientFacade
21902179

21912180
facade = facade_cls.from_connection(self.connection())
21922181
result = await facade.GetModelConstraints()
@@ -2307,8 +2296,7 @@ async def set_constraints(self, constraints):
23072296
:param dict config: Mapping of model constraints
23082297
"""
23092298
facade_cls = client.ModelConfigFacade
2310-
# if self.connection().is_using_old_client:
2311-
# facade_cls = client.ClientFacade
2299+
23122300
facade = facade_cls.from_connection(self.connection())
23132301

23142302
await facade.SetModelConstraints(

0 commit comments

Comments
 (0)