from juju import tag, utils
from juju.client import client
-from juju.client.version_map import VERSION_MAP
from juju.errors import JujuError, JujuAPIError, JujuConnectionError
from juju.utils import IdQueue
def build_facades(self, facades):
self.facades.clear()
- # In order to work around an issue where the juju api is not
- # returning a complete list of facades, we simply look up the
- # juju version in a pregenerated map, and use that info to
- # populate our list of facades.
-
- # TODO: if a future version of juju fixes this bug, restore
- # the following code for that version and higher:
- # for facade in facades:
- # self.facades[facade['name']] = facade['versions'][-1]
- try:
- self.facades = VERSION_MAP[self.info['server-version']]
- except KeyError:
- log.warning("Could not find a set of facades for {}. Using "
- "the latest facade set instead".format(
- self.info['server-version']))
- self.facades = VERSION_MAP['latest']
+ for facade in facades:
+ self.facades[facade['name']] = facade['versions'][-1]
async def login(self):
username = self.username