code: async def connect_controller(self, controller_name=None):
          
          if not controller_name:
              controller_name = self.jujudata.current_controller()
          if not controller_name:
              raise JujuConnectionError('No current controller')
  
          controller = self.jujudata.controllers()[controller_name]
          # TODO change Connection so we can pass all the endpoints
          # instead of just the first.
          endpoint = controller['api-endpoints'][0]
          accounts = self.jujudata.accounts().get(controller_name, {})
  
          await self.connect(
              endpoint=endpoint,
              uuid=None,
              username=accounts.get('user'),
              password=accounts.get('password'),
              cacert=controller.get('ca-cert'),
              bakery_client=self.bakery_client_for_controller(controller_name),
          )
          self.controller_name = controller_name
docs: Connect to a controller by name. If the name is empty, it
          connect to the current controller.